oglimmer/fulgens

View on GitHub

Showing 57 of 57 total issues

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

class TomeePlugin extends BasePlugin {

  static instance() {
    return new TomeePlugin();
  }
Severity: Major
Found in classes/plugins/TomeePlugin.js and 1 other location - About 1 wk to fix
classes/plugins/TomcatPlugin.js on lines 25..132

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

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

class TomcatPlugin extends BasePlugin {

  static instance() {
    return new TomcatPlugin();
  }
Severity: Major
Found in classes/plugins/TomcatPlugin.js and 1 other location - About 1 wk to fix
classes/plugins/TomeePlugin.js on lines 30..137

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

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

    this.build = () => nunjucks.render('classes/plugins/ShellPlugin.tmpl', {
      ...this.nunjucksObj(),
      typeSourceVarName,
      softwareComponentName,
      systemName,
Severity: Major
Found in classes/plugins/ShellPlugin.js and 1 other location - About 6 hrs to fix
classes/plugins/JavaPlugin.js on lines 128..145

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

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

    this.build = () => nunjucks.render('classes/plugins/JavaPlugin.tmpl', {
      ...this.nunjucksObj(),
      typeSourceVarName,
      ArtifactRpld,
      pidFile,
Severity: Major
Found in classes/plugins/JavaPlugin.js and 1 other location - About 6 hrs to fix
classes/plugins/ShellPlugin.js on lines 67..84

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

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

  exec(softwareComponentName, userConfig, runtimeConfiguration) {
    super.exec(softwareComponentName, userConfig, runtimeConfiguration);

    const { Name: systemName } = userConfig.config;
    const { Deploy, Lib, EnvVars = [], SourceTypes = ['docker','download','local'], DockerImage = 'tomcat', ExposedPort = '8080', DockerMemory } = userConfig.software[softwareComponentName];
Severity: Major
Found in classes/plugins/TomcatPlugin.js - About 3 hrs to fix

    Function exec has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      exec(softwareComponentName, userConfig, runtimeConfiguration) {
        super.exec(softwareComponentName, userConfig, runtimeConfiguration);
    
        const { Name: systemName } = userConfig.config;
        const { Deploy, Lib, EnvVars = [], SourceTypes = ['docker','download','local'], DockerImage = 'tomee', ExposedPort = '8080', DockerMemory } = userConfig.software[softwareComponentName];
    Severity: Major
    Found in classes/plugins/TomeePlugin.js - About 3 hrs to fix

      Function exec has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

        exec(softwareComponentName, userConfig, runtimeConfiguration) {
          if (userConfig.software[softwareComponentName]) {
            const { Git, Param, Dir, BeforeStart, AfterStart } = userConfig.software[softwareComponentName];
      
            if (Param) {
      Severity: Minor
      Found in classes/plugins/BasePlugin.js - About 2 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 exec has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        exec(softwareComponentName, userConfig, runtimeConfiguration) {
          super.exec(softwareComponentName, userConfig, runtimeConfiguration);
      
          const { Name: systemName } = userConfig.config;
          const { Start, Node, EnvVars = [], ExposedPort = '3000', BeforeBuild = [], AfterBuild = [], DockerImage = 'node', DockerMemory } = userConfig.software[softwareComponentName];
      Severity: Major
      Found in classes/plugins/NodePlugin.js - About 2 hrs to fix

        Function exec has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          exec(softwareComponentName, userConfig, runtimeConfiguration) {
            if (userConfig.software[softwareComponentName]) {
              const { Git, Param, Dir, BeforeStart, AfterStart } = userConfig.software[softwareComponentName];
        
              if (Param) {
        Severity: Major
        Found in classes/plugins/BasePlugin.js - About 2 hrs to fix

          Function exec has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            exec(softwareComponentName, userConfig, runtimeConfiguration) {
              super.exec(softwareComponentName, userConfig, runtimeConfiguration);
          
              const { Name: systemName, JavaVersions } = userConfig.config;
              const { Start, ExposedPort, EnvVars = [], DockerImage = 'openjdk', DockerMemory } = userConfig.software[softwareComponentName];
          Severity: Major
          Found in classes/plugins/JavaPlugin.js - About 2 hrs to fix

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

              exec(softwareComponentName, userConfig, runtimeConfiguration) {
                super.exec(softwareComponentName, userConfig, runtimeConfiguration);
            
                const { Name: systemName } = userConfig.config;
                const { Start, ExposedPort, DockerImage = 'ubuntu', EnvVars = [], DockerMemory } = userConfig.software[softwareComponentName];
            Severity: Major
            Found in classes/plugins/ShellPlugin.js - About 2 hrs to fix

              Function exec has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                exec(softwareComponentName, userConfig, runtimeConfiguration) {
                  super.exec(softwareComponentName, userConfig, runtimeConfiguration);
              
                  const { Name: systemName } = userConfig.config;
                  const { CouchDB, EnvVars = [], DockerImage = 'couchdb', ExposedPort = '5984', DockerMemory } = userConfig.software[softwareComponentName];
              Severity: Minor
              Found in classes/plugins/CouchdbPlugin.js - About 1 hr to fix

                Function exec has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  exec(softwareComponentName, userConfig, runtimeConfiguration) {
                    super.exec(softwareComponentName, userConfig, runtimeConfiguration);
                
                    const { Name: systemName } = userConfig.config;
                    const { Mysql, EnvVars = [], DockerImage = 'mysql', ExposedPort = '3306', DockerMemory } = userConfig.software[softwareComponentName];
                Severity: Minor
                Found in classes/plugins/MysqlPlugin.js - About 1 hr to fix

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

                    exec(softwareComponentName, userConfig, runtimeConfiguration) {
                      super.exec(softwareComponentName, userConfig, runtimeConfiguration);
                  
                      const { Name: systemName } = userConfig.config;
                      const { EnvVars = [], DockerImage = 'redis', ExposedPort = '6379', DockerMemory } = userConfig.software[softwareComponentName];
                  Severity: Minor
                  Found in classes/plugins/RedisPlugin.js - About 1 hr to fix

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

                      exec(softwareComponentName, userConfig, runtimeConfiguration) {
                        super.exec(softwareComponentName, userConfig, runtimeConfiguration);
                        
                        const { JavaVersions, UseHomeM2 } = userConfig.config;
                        const { DockerImage = 'maven' } = userConfig.software[softwareComponentName];
                    Severity: Minor
                    Found in classes/plugins/MvnPlugin.js - About 1 hr to fix

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

                          if (aptDebian8.size > 0) {
                            bufferDebian8 = hasNode(aptDebian8) ? 'curl -sL https://deb.nodesource.com/setup_6.x | bash -;' : '';
                            bufferDebian8 += ` apt-get -qy install ${[...aptDebian8.values()].join(' ')};`
                          }
                      Severity: Major
                      Found in classes/core/DependencyManager.js and 1 other location - About 1 hr to fix
                      classes/core/DependencyManager.js on lines 94..97

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

                      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

                          if (aptDebian9.size > 0) {
                            bufferDebian9 = hasNode(aptDebian9) ? 'curl -sL https://deb.nodesource.com/setup_6.x | bash -;' : '';
                            bufferDebian9 += ` apt-get -qy install ${[...aptDebian9.values()].join(' ')};`;
                          }
                      Severity: Major
                      Found in classes/core/DependencyManager.js and 1 other location - About 1 hr to fix
                      classes/core/DependencyManager.js on lines 86..89

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

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

                        exec(softwareComponentName, userConfig, runtimeConfiguration) {
                          super.exec(softwareComponentName, userConfig, runtimeConfiguration);
                          
                          const { DockerImage = 'node' } = userConfig.software[softwareComponentName];
                      
                      
                      Severity: Minor
                      Found in classes/plugins/NpmPlugin.js - About 1 hr to fix

                        Function createFile has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          createFile() {
                            // start with loading default content if given
                            var content = [];
                            if (this.LoadDefaultContent) {
                              var contentBlock;
                        Severity: Minor
                        Found in classes/core/configFile/BaseConfigFile.js - About 1 hr to fix

                          Function getAptBuild has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            getAptBuild() {
                              if (this.aptPackages.size == 0) {
                                return ';';
                              }
                              // aptDebian8 contains all packages supposed to be install on Debian 8.x
                          Severity: Minor
                          Found in classes/core/DependencyManager.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language