webgme/webgme-cli

View on GitHub

Showing 51 of 51 total issues

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

AddonGenerator.prototype.main = function (callback) {
  var self = this;
  WebGMEAddonGenerator.prototype.main.call(this, function (e, result) {
    if (e) {
      this.logger.error(e);
Severity: Major
Found in src/shim/AddonGenerator.js and 1 other location - About 1 day to fix
src/shim/DecoratorGenerator.js on lines 32..52

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 207.

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

DecoratorGenerator.prototype.main = function (callback) {
  var self = this;
  WebGMEDecoratorGenerator.prototype.main.call(this, function (e, result) {
    if (e) {
      this.logger.error(e);
Severity: Major
Found in src/shim/DecoratorGenerator.js and 1 other location - About 1 day to fix
src/shim/AddonGenerator.js on lines 32..52

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 207.

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

DecoratorManager.prototype._getPathFromGME = function (installInfo) {
  var pkgProject = installInfo.pkg,
    gmeConfigPath = utils.getGMEConfigPath(pkgProject.toLowerCase()),
    name = installInfo.name,
    componentPath,
Severity: Major
Found in src/DecoratorManager.js and 1 other location - About 7 hrs to fix
src/AddonManager.js on lines 92..113

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 192.

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

AddonManager.prototype._getPathFromGME = function (installInfo) {
  var pkgProject = installInfo.pkg,
    gmeConfigPath = utils.getGMEConfigPath(pkgProject.toLowerCase()),
    name = installInfo.name,
    componentPath,
Severity: Major
Found in src/AddonManager.js and 1 other location - About 7 hrs to fix
src/DecoratorManager.js on lines 87..108

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 192.

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

    R.values(self.blobClient.artifacts).forEach(function (artifact) {
      artifact.files.forEach(fixFilePath);
      // Fix the require path for the unit test
      var test = artifact.files.filter(function (file) {
        return file.name.indexOf("test") === 0;
Severity: Major
Found in src/shim/LayoutGenerator.js and 1 other location - About 6 hrs to fix
src/shim/PluginGenerator.js on lines 43..57

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 168.

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

    R.values(self.blobClient.artifacts).forEach(function (artifact) {
      artifact.files.forEach(fixFilePath);
      // Fix the require path for the unit test
      var test = artifact.files.filter(function (file) {
        return file.name.indexOf("test") === 0;
Severity: Major
Found in src/shim/PluginGenerator.js and 1 other location - About 6 hrs to fix
src/shim/LayoutGenerator.js on lines 43..57

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 168.

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

Enableable.prototype.enable = function (args, callback) {
  this._invokePlugin(
    args,
    "enable",
    function (err, result) {
Severity: Major
Found in src/mixins/Enableable/Enableable.js and 1 other location - About 4 hrs to fix
src/mixins/Enableable/Enableable.js on lines 81..95

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 122.

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

Enableable.prototype.disable = function (args, callback) {
  this._invokePlugin(
    args,
    "disable",
    function (err, result) {
Severity: Major
Found in src/mixins/Enableable/Enableable.js and 1 other location - About 4 hrs to fix
src/mixins/Enableable/Enableable.js on lines 65..79

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 122.

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 utils.js has 347 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*globals define*/
"use strict";

const childProcess = require("child_process");
const spawn = childProcess.exec;
Severity: Minor
Found in src/utils.js - About 4 hrs to fix

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

      var RemoveFromPlugin = function () {
        // Call base class' constructor.
        PluginBase.call(this);
        this.pluginMetadata = {
          name: "ComponentDisabler",
    Severity: Major
    Found in src/mixins/Enableable/RemoveFromPlugin/RemoveFromPlugin.js and 1 other location - About 4 hrs to fix
    src/mixins/Enableable/AddToPlugin/AddToPlugin.js on lines 18..43

    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 121.

    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

      var AddToPlugin = function () {
        // Call base class' constructor.
        PluginBase.call(this);
        this.pluginMetadata = {
          name: "ComponentEnabler",
    Severity: Major
    Found in src/mixins/Enableable/AddToPlugin/AddToPlugin.js and 1 other location - About 4 hrs to fix
    src/mixins/Enableable/RemoveFromPlugin/RemoveFromPlugin.js on lines 18..43

    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 121.

    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 getRequireJSPaths has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var getRequireJSPaths = function (config, startPath) {
      var componentTypes = Object.keys(config.dependencies),
        components,
        paths = [],
        names,
    Severity: Major
    Found in src/utils.js - About 2 hrs to fix

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

      DecoratorManager.prototype._getOptions = function () {
        return RAW_CONFIG.map(function (config) {
          return PluginHelpers.getConfigValue[config.valueType](config);
        }).filter(function (opt) {
          return opt.name.indexOf("meta") === -1;
      Severity: Major
      Found in src/DecoratorManager.js and 1 other location - About 2 hrs to fix
      src/PluginManager.js on lines 38..44

      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 90.

      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

      PluginManager.prototype._getOptions = function () {
        return RAW_CONFIG.map(function (config) {
          return PluginHelpers.getConfigValue[config.valueType](config);
        }).filter(function (opt) {
          return opt.name.indexOf("meta") === -1;
      Severity: Major
      Found in src/PluginManager.js and 1 other location - About 2 hrs to fix
      src/DecoratorManager.js on lines 43..49

      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 90.

      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 ComponentManager.js has 269 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*globals define*/
      /*
       * This is the basic structure for component managers
       *
       * In the component manager, all public functions (functions not preceded by a _)
      Severity: Minor
      Found in src/ComponentManager.js - About 2 hrs to fix

        Function new has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        SeedManager.prototype.new = function (args, callback) {
          var gmeConfigPath = utils.getGMEConfigPath(),
            gmeConfig = require(gmeConfigPath),
            projectName = args.project,
            name = (args.seedName || projectName).replace(/\.js(on)?$/, ""),
        Severity: Major
        Found in src/SeedManager.js - About 2 hrs to fix

          Function import has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          webgme.all.import = function (projectName, opts, callback) {
            let rootPath;
          
            opts = opts || {};
            return Q()
          Severity: Major
          Found in index.js - About 2 hrs to fix

            Function init has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            BaseManager.prototype.init = function (args, callback) {
              // Create new project
              var project, name, err;
            
              project = path.resolve(args.name || process.cwd());
            Severity: Major
            Found in src/BaseManager.js - About 2 hrs to fix

              Function dockerize has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              DockerizeManager.prototype.dockerize = function (args) {
                utils.changeToRootDir();
              
                const tempToFileInfo = [];
                let outfiles = OUT_FILES.DEFAULT;
              Severity: Major
              Found in src/DockerizeManager.js - About 2 hrs to fix

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

                PluginManager.prototype.new = function (options, callback) {
                  // Set the config options from the command line flags
                  var self = this,
                    config = this._parseConfig(options),
                    pluginGenerator = new PluginGenerator(this._logger, config);
                Severity: Minor
                Found in src/PluginManager.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language