TOTVSTEC/cloudbridge-cli

View on GitHub

Showing 76 of 179 total issues

Function printUsage has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    static printUsage(d) {
        var w = function(s) {
            process.stdout.write(s);
        };

Severity: Minor
Found in src/help.js - About 5 hrs 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 check_android has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

Checker.check_android = function() {
    return Q().then(function() {
        var androidCmdPath = forgivingWhichSync('android');
        var adbInPath = !!forgivingWhichSync('adb');
        var hasAndroidHome = !!process.env.ANDROID_HOME && fs.existsSync(process.env.ANDROID_HOME);
Severity: Minor
Found in src/kits/android/checker.js - About 4 hrs 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 fetchArchive has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Utils.fetchArchive = function fetchArchive(targetPath, archiveUrl, isGui) {
    var q = Q.defer();

    // The folder name the project will be downloaded and extracted to
    var message = ['\nDownloading:'.bold, archiveUrl].join(' ');
Severity: Major
Found in src/utils/utils.js - About 3 hrs to fix

    Function printUsage has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static printUsage(d) {
            var w = function(s) {
                process.stdout.write(s);
            };
    
    
    Severity: Major
    Found in src/help.js - About 3 hrs to fix

      Function check_android has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Checker.check_android = function() {
          return Q().then(function() {
              var androidCmdPath = forgivingWhichSync('android');
              var adbInPath = !!forgivingWhichSync('adb');
              var hasAndroidHome = !!process.env.ANDROID_HOME && fs.existsSync(process.env.ANDROID_HOME);
      Severity: Major
      Found in src/kits/android/checker.js - About 2 hrs to fix

        Function run has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Cli.run = function run(processArgv, processCwd) {
            this.cwd = processCwd || process.cwd();
        
            try {
                //First we parse out the args to use them.
        Severity: Major
        Found in src/cli.js - About 2 hrs to fix

          File start.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          'use strict';
          
          var fs = require('fs'),
              path = require('path'),
              shelljs = require('shelljs'),
          Severity: Minor
          Found in src/tasks/default/start.js - About 2 hrs to fix

            Function check_java has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Checker.check_java = function() {
                var javacPath = forgivingWhichSync('javac');
                var hasJavaHome = !!process.env.JAVA_HOME;
            
                return Q().then(function() {
            Severity: Major
            Found in src/kits/android/checker.js - About 2 hrs to fix

              File update.js has 255 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              var AppTask = require('./app-task'),
                  Package = cb_require('utils/package'),
                  bower = cb_require('utils/bower'),
              Severity: Minor
              Found in src/tasks/default/update.js - About 2 hrs to fix

                Function run has 51 lines of code (exceeds 25 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: Major
                Found in src/tasks/default/advpl-compile.js - About 2 hrs to fix

                  File info.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  'use strict';
                  
                  var path = require('path'),
                      shelljs = require('shelljs'),
                      os = require('os'),
                  Severity: Minor
                  Found in src/utils/info.js - About 2 hrs to fix

                    Function startApp has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        static startApp(options) {
                            var name = options.appDirectory,
                                id = options.packageName,
                                backend = ionic.config.get('backend', '--global');
                    
                    
                    Severity: Minor
                    Found in src/tasks/ionic/start.js - About 1 hr to fix

                      Function install has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          static install(target, packagePath, opts) {
                              console.log('Installing apk ' + packagePath + ' on target ' + target + '...\n');
                      
                              var args = ['-s', target, 'install'];
                      
                      
                      Severity: Minor
                      Found in src/kits/android/adb.js - About 1 hr to fix

                        Function update has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            update(platforms) {
                                var _this = this,
                                    projectData = this.project.data();
                        
                                if (platforms.length === 0) {
                        Severity: Minor
                        Found in src/tasks/ionic/platform-update.js - About 1 hr to fix

                          Function update has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              update(platforms) {
                                  var _this = this,
                                      projectData = this.project.data();
                          
                                  if (platforms.length === 0) {
                          Severity: Minor
                          Found in src/tasks/cordova/platform-update.js - About 1 hr to fix

                            Function setUpConsoleLoggingHelpers has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Logging.setUpConsoleLoggingHelpers = function setUpConsoleLoggingHelpers() {
                                colors.setTheme({
                                    silly: 'rainbow',
                                    input: 'grey',
                                    small: 'grey',
                            Severity: Minor
                            Found in src/utils/logging.js - About 1 hr to fix

                              Function run has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  run(cloudbridge, argv) {
                                      let forceClean = this.needClean(argv),
                                          task = new AdvplCompileTask(this.options),
                                          promise = task.run(cloudbridge, argv);
                              
                              
                              Severity: Minor
                              Found in src/tasks/default/build-android.js - About 1 hr to fix

                                Function latest has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    latest() {
                                        var deferred = Q.defer(),
                                            etag = this.getEtag(),
                                            url = 'https://api.github.com/repos/' + this.group + '/' + this.name + '/tags',
                                            _this = this,
                                Severity: Minor
                                Found in src/utils/package.js - About 1 hr to fix

                                  Function checkRuntime has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Info.checkRuntime = function checkRuntime() {
                                      var info = this.gatherInfo(),
                                          iosDeployInstalled = false,
                                          iosSimInstalled = false,
                                          nodeUpgrade = false,
                                  Severity: Minor
                                  Found in src/utils/info.js - About 1 hr to fix

                                    Function run has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        run(cloudbridge, argv) {
                                            var project = this.project.data(),
                                                packagePath = path.join(this.projectDir, 'src', 'ios', 'build', 'Release-iphoneos', project.name + '.app');
                                    
                                            return this.build(argv)
                                    Severity: Minor
                                    Found in src/tasks/default/run-ios.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language