TOTVSTEC/cloudbridge-cli

View on GitHub

Showing 76 of 179 total issues

Function attachErrorHandling has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

Cli.attachErrorHandling = function attachErrorHandling() {
    this.utils.errorHandler = function errorHandler(msg, taskHelp) {
        try {
            cli.logging.logger.debug('cli.utils.errorHandler msg', msg, typeof msg);

Severity: Minor
Found in src/cli.js - About 45 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

Function list has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    list() {
        let homeDir = process.env.HOME || process.env.USERPROFILE || process.env.HOMEPATH,
            packageDir = path.join(homeDir, '.cloudbridge', 'packages'),
            groups = [];

Severity: Minor
Found in src/tasks/default/cache.js - About 45 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

Avoid deeply nested control flow statements.
Open

                    if (!javacPath) {
                        process.env.PATH += path.delimiter + path.join(firstJdkDir, 'bin');
                    }
Severity: Major
Found in src/kits/android/checker.js - About 45 mins to fix

    Function printAvailableTasks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    Cli.printAvailableTasks = function printAvailableTasks(argv) {
        Cli.printCloudBridge();
        process.stderr.write('\nUsage: cloudbridge task args\n\n=======================\n\n');
    
        if (process.argv.length > 2) {
    Severity: Minor
    Found in src/cli.js - About 35 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

    Function printAvailableTasks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        static printAvailableTasks(argv) {
            this.printBanner();
    
            process.stderr.write('\nUsage: cloudbridge task args\n\n=======================\n\n');
    
    
    Severity: Minor
    Found in src/help.js - About 35 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

    Function getEngine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    Cli.getEngine = function getEngine(argv) {
        var engine = 'default',
            projectFile = path.join(this.cwd, 'cloudbridge.json');
    
        if (fs.existsSync(projectFile)) {
    Severity: Minor
    Found in src/cli.js - About 35 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

    Function printInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    Info.printInfo = function printInfo(info) {
        logging.logger.info('\nYour system information:\n'.bold);
    
        if (info.gulp) {
            logging.logger.info('Gulp version:', info.gulp);
    Severity: Minor
    Found in src/utils/info.js - About 35 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

    Function modifier has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        static modifier(range) {
            if (typeof range === 'string') {
                var modifier = range.trim();
    
                if (modifier.length > 0) {
    Severity: Minor
    Found in src/utils/semver.js - About 35 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

    Function constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        constructor(name, group, version) {
            if (typeof name === 'object') {
                var options = name;
    
                this.name = options.name;
    Severity: Minor
    Found in src/utils/package.js - About 35 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

    Avoid too many return statements within this function.
    Open

            return this.utils.fail(ex);
    Severity: Major
    Found in src/cli.js - About 30 mins to fix

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

          run(cloudbridge, argv) {
              try {
                  var isAddCmd = argv._.indexOf('add') !== -1;
                  var isRmCmd = argv._.indexOf('rm') !== -1 || argv._.indexOf('remove') !== -1;
                  var isUpdateCmd = argv._.indexOf('up') !== -1 || argv._.indexOf('update') !== -1;
      Severity: Minor
      Found in src/tasks/default/platform.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

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

          run(cloudbridge, argv) {
              try {
                  var isAddCmd = argv._.indexOf('add') !== -1;
                  var isRmCmd = argv._.indexOf('rm') !== -1 || argv._.indexOf('remove') !== -1;
                  var isUpdateCmd = argv._.indexOf('up') !== -1 || argv._.indexOf('update') !== -1;
      Severity: Minor
      Found in src/tasks/ionic/platform.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

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

          run(cloudbridge, argv) {
              if (argv.list || argv.l) {
                  var listTask = new StartListTask(this.options);
      
                  return listTask.run(cloudbridge);
      Severity: Minor
      Found in src/tasks/default/start.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

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

          createChoices(packageType, longest) {
              var choices = [],
                  packages = this.packages[packageType];
      
              if (!Array.isArray(packages)) {
      Severity: Minor
      Found in src/tasks/default/update.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

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

          run(cloudbridge, argv) {
              try {
                  var isAddCmd = argv._.indexOf('add') !== -1;
                  var isRmCmd = argv._.indexOf('rm') !== -1 || argv._.indexOf('remove') !== -1;
                  var isUpdateCmd = argv._.indexOf('up') !== -1 || argv._.indexOf('update') !== -1;
      Severity: Minor
      Found in src/tasks/cordova/platform.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

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

          run(cloudbridge, argv) {
              let cleanFiles = [];
      
              if (argv.clean || argv.c) {
                  cleanFiles = Object.keys(fileUtils.loadModifiedTime(this.projectDir, ADVPL_SRC_RELATIVE));
      Severity: Minor
      Found in src/tasks/default/advpl-compile.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