MitocGroup/recink

View on GitHub

Showing 12 of 14 total issues

File search_index.js has 2300 lines of code (exceeds 600 allowed). Consider refactoring.
Open

window.esdocSearchIndex = [
  [
    "recink/src/component/abstract-component.js~abstractcomponent",
    "class/src/component/abstract-component.js~AbstractComponent.html",
    "<span>AbstractComponent</span> <span class=\"search-result-import-path\">recink/src/component/abstract-component.js</span>",
Severity: Major
Found in docs/api/script/search_index.js - About 5 days to fix

    Function report has a Cognitive Complexity of 57 (exceeds 10 allowed). Consider refactoring.
    Open

      report(result, options, _info = true) {
        const blueUnderline = this.colors ? this.logger.chalk.blue.underline : (t => t);
        const gray = this.colors ? this.logger.chalk.gray : (t => t);
        const grayBold = this.colors ? this.logger.chalk.gray.bold : (t => t);
        const red = this.colors ? this.logger.chalk.red : (t => t);
    Severity: Minor
    Found in components/snyk/src/reporter/text-reporter.js - About 1 day 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

    TerraformComponent has 39 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class TerraformComponent extends DependencyBasedComponent {
      /**
       * @param {*} args 
       */
      constructor(...args) {
    Severity: Minor
    Found in components/terraform/src/terraform-component.js - About 5 hrs to fix

      Terraform has 31 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Terraform {
        /**
         * @param {String} binary
         * @param {String} resource
         * @param {Object} vars
      Severity: Minor
      Found in components/terraform/src/terraform.js - About 3 hrs to fix

        Function exports has 161 lines of code (exceeds 100 allowed). Consider refactoring.
        Open

        module.exports = (args, options, logger) => {
          const recink = new Recink();
        
          let cfg = {};
          let namespace = args.name;
        Severity: Major
        Found in bin/commands/run/generic.js - About 3 hrs to fix

          Function exports has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring.
          Open

          module.exports = (args, options, logger) => {
            const recink = new Recink();
          
            let cfg = {};
            let namespace = args.name;
          Severity: Minor
          Found in bin/commands/run/generic.js - About 1 hr 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 exports has 102 lines of code (exceeds 100 allowed). Consider refactoring.
          Open

          module.exports = (args, options, logger) => {
            const githubUsername = options.githubUsername;
            const githubPassword = options.githubPassword;
            const githubToken = options.githubToken;
            
          Severity: Major
          Found in bin/commands/travis/encrypt.js - About 1 hr to fix

            Function report has 101 lines of code (exceeds 100 allowed). Consider refactoring.
            Open

              report(result, options, _info = true) {
                const blueUnderline = this.colors ? this.logger.chalk.blue.underline : (t => t);
                const gray = this.colors ? this.logger.chalk.gray : (t => t);
                const grayBold = this.colors ? this.logger.chalk.gray.bold : (t => t);
                const red = this.colors ? this.logger.chalk.red : (t => t);
            Severity: Major
            Found in components/snyk/src/reporter/text-reporter.js - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                      if (link) location.href = link.href;
              Severity: Major
              Found in docs/api/script/search.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if (innerButton && innerButton.classList.contains('opened')) {
                            innerButton.classList.remove('opened');
                            innerButton.classList.add('closed');
                          }
                Severity: Major
                Found in docs/api/script/test-summary.js - About 45 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return multiReporter.report(result, options)
                        .then(() => this._handleFail(result));
                  Severity: Major
                  Found in components/snyk/src/snyk-component.js - About 30 mins to fix

                    Function _createReport has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
                    Open

                      _createReport(npmModule, emitModule, result, options) {
                        if (result && typeof result === 'object' && result instanceof Error) {
                          if (/package\.json\sis\snot\sa\snode\sproject/i.test(result.message)) {
                            this.logger.info(
                              this.logger.emoji.cross,
                    Severity: Minor
                    Found in components/snyk/src/snyk-component.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