TOTVSTEC/cloudbridge-cli

View on GitHub

Showing 179 of 179 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

Info.getIosDeployInfo = function getIosDeployInfo() {
    var result = shelljs.exec('ios-deploy --version', { silent: true });
    if (result.code !== 0) {
        return 'Not installed';
    }
Severity: Major
Found in src/utils/info.js and 2 other locations - About 2 hrs to fix
src/utils/info.js on lines 45..53
src/utils/info.js on lines 55..62

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 81.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

Info.getXcodeInfo = function getXcodeInfo() {
    var result = shelljs.exec('/usr/bin/xcodebuild -version', { silent: true });

    if (result.code !== 0) {
        return 'Not installed';
Severity: Major
Found in src/utils/info.js and 2 other locations - About 2 hrs to fix
src/utils/info.js on lines 55..62
src/utils/info.js on lines 64..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 81.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

Info.getIosSimInfo = function getIosSimInfo() {
    var result = shelljs.exec('ios-sim --version', { silent: true });
    if (result.code !== 0) {
        return 'Not installed';
    }
Severity: Major
Found in src/utils/info.js and 2 other locations - About 2 hrs to fix
src/utils/info.js on lines 45..53
src/utils/info.js on lines 64..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 81.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

        constructor(options) {
            super(options);
    
            IOS_SRC = path.join(this.projectDir, "platforms", "ios");
            RPO_SRC = path.join(this.projectDir, "src", "apo");
    Severity: Major
    Found in src/tasks/cordova/build-ios.js and 3 other locations - About 2 hrs to fix
    src/tasks/cordova/build-android.js on lines 19..25
    src/tasks/ionic/build-android.js on lines 20..26
    src/tasks/ionic/build-ios.js on lines 18..24

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

        constructor(options) {
            super(options);
    
            ANDROID_SRC = path.join(this.projectDir, "platforms", "android");
            RPO_SRC = path.join(this.projectDir, "src", "apo");
    Severity: Major
    Found in src/tasks/cordova/build-android.js and 3 other locations - About 2 hrs to fix
    src/tasks/cordova/build-ios.js on lines 18..24
    src/tasks/ionic/build-android.js on lines 20..26
    src/tasks/ionic/build-ios.js on lines 18..24

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

        constructor(options) {
            super(options);
    
            ANDROID_SRC = path.join(this.projectDir, "platforms", "android");
            RPO_SRC = path.join(this.projectDir, "src", "apo");
    Severity: Major
    Found in src/tasks/ionic/build-android.js and 3 other locations - About 2 hrs to fix
    src/tasks/cordova/build-android.js on lines 19..25
    src/tasks/cordova/build-ios.js on lines 18..24
    src/tasks/ionic/build-ios.js on lines 18..24

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

        constructor(options) {
            super(options);
    
            IOS_SRC = path.join(this.projectDir, "platforms", "ios");
            RPO_SRC = path.join(this.projectDir, "src", "apo");
    Severity: Major
    Found in src/tasks/ionic/build-ios.js and 3 other locations - About 2 hrs to fix
    src/tasks/cordova/build-android.js on lines 19..25
    src/tasks/cordova/build-ios.js on lines 18..24
    src/tasks/ionic/build-android.js on lines 20..26

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                    for (x = 0; x < optDescs.length; x++) {
                        if (x === 0) {
                            w(optDescs[x].bold);
                        }
                        else {
    Severity: Major
    Found in src/help.js and 1 other location - About 2 hrs to fix
    src/help.js on lines 116..123

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                for (x = 0; x < argDescs.length; x++) {
                    if (x === 0) {
                        w(argDescs[x].bold);
                    }
                    else {
    Severity: Major
    Found in src/help.js and 1 other location - About 2 hrs to fix
    src/help.js on lines 160..167

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              if (!options.appName) {
                  var appNameSplit = options.appDirectory.split('/');
                  appNameSplit = appNameSplit[appNameSplit.length - 1].split('\\');
                  options.appName = appNameSplit[appNameSplit.length - 1];
              }
          Severity: Major
          Found in src/utils/utils.js and 1 other location - About 1 hr to fix
          src/utils/utils.js on lines 264..268

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 73.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  if (!options.appName) {
                      var appNameSplit = options.appDirectory.split('/');
                      appNameSplit = appNameSplit[appNameSplit.length - 1].split('\\');
                      options.appName = appNameSplit[appNameSplit.length - 1];
                  }
          Severity: Major
          Found in src/utils/utils.js and 1 other location - About 1 hr to fix
          src/utils/utils.js on lines 241..248

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 73.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              return Utils.fetchArchive(packageDir, url, false).then(function() {
                  var contentDir = path.join(packageDir, options.package + '-' + options.version);
          
                  shelljs.mv(contentDir, outputDir);
          
          
          Severity: Major
          Found in src/utils/utils.js and 1 other location - About 1 hr to fix
          src/utils/package.js on lines 214..221

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 73.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  return utils.fetchArchive(packageDir, url, false)
                      .then(function() {
                          var contentDir = path.join(packageDir, _this.name + '-' + _this.version);
          
                          shelljs.mv(contentDir, outputDir);
          Severity: Major
          Found in src/utils/package.js and 1 other location - About 1 hr to fix
          src/utils/utils.js on lines 94..100

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 73.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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
                Severity
                Category
                Status
                Source
                Language