alexlemaire/git-assist

View on GitHub

Showing 7 of 19 total issues

Function exports has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = async () => {
  const inquirer = require('inquirer')
  const git = require('isomorphic-git')
  const fs = require('fs')
  const dir = '.'
Severity: Minor
Found in src/functions/pull/helpers/git-process/info-prompter.js - About 1 hr to fix

    Function exports has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = async (fcts, args) => {
      const inquirer = require('inquirer')
      require(appRoot + '/src/utils/welcome/welcome.js')
      const { action } = await inquirer.prompt([
        {
    Severity: Minor
    Found in src/utils/no-args/no-args.js - About 1 hr to fix

      Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = (type, key) => {
        const chalk = require('chalk')
        const Conf = require('conf')
        const keyConfig = new Conf({
          configName: type,
      Severity: Minor
      Found in src/utils/key-gen/delete-key.js - About 1 hr to fix

        Function processAction has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        async function processAction (processes, res) {
          const { action } = await getAction(processes)
          switch (action) {
            case 'nothing': {
              res.scheduled = false
        Severity: Minor
        Found in src/functions/auto-pull/helpers/schedule-prompter.js - About 1 hr to fix

          Function getQuestions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function getQuestions () {
            return [
              {
                type: 'input',
                name: 'email',
          Severity: Minor
          Found in src/functions/ssh/helpers/generate/info-prompter.js - About 1 hr to fix

            Function main has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            (async function main () {
              const inquirer = require('inquirer')
              const clog = require('../../src/utils/loggers/logger.js')({ filename: 'add-function-tool.log' })
              clog.heading('START ADD-FUNCTION tool')
              clog.info('This function will create a new utility function for you.')
            Severity: Minor
            Found in tools/add-function/add-function.js - About 1 hr to fix

              Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = async (args) => {
                const Conf = require('conf')
                const chalk = require('chalk')
                const config = new Conf({
                  configName: 'auto-pull',
              Severity: Minor
              Found in src/functions/auto-pull/index.js - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language