jish/pre-commit

View on GitHub

Showing 171 of 259 total issues

Avoid deeply nested control flow statements.
Open

                                if (!nextLine()) {
                                    errorAt("Unclosed HTML comment.", l, c);
                                }
Severity: Major
Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (typeof b !== 'number' || !isFinite(b) || b <= 0 ||
                                Math.floor(b) !== b) {
                            error("Expected a small integer and instead saw '{a}'.",
                                    v, v.value);
                        }
    Severity: Major
    Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

              } else if (a === 'name') {
                  if (option.adsafe && v.indexOf('_') >= 0) {
                      warning("ADsafe name violation.");
                  }
              }
      Severity: Major
      Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (classCount > 1){
                                        reporter.report("Don't use adjoining classes.", part.line, part.col, rule);
                                    }
        Severity: Major
        Found in lib/pre-commit/support/csslint/csslint.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                          for (;;) {
                                              c = s.charAt(0);
                                              if ((c < '0' || c > '9') &&
                                                      (c < 'a' || c > 'f') &&
                                                      (c < 'A' || c > 'F')) {
          Severity: Major
          Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (l + n.length > 72) {
                                        o.push(m + '<br>');
                                        m = '    ';
                                        l = 1;
                                    }
            Severity: Major
            Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (nexttoken.id !== ',') {
                                          break;
                                      }
              Severity: Major
              Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (i < a.length - 1) {
                                            n += ', ';
                                        }
                Severity: Major
                Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (v === 'unused') {
                                              unused.push({
                                                  name: n,
                                                  line: f['(line)'],
                                                  'function': f['(name)']
                  Severity: Major
                  Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (data.member[k] === 1) {
                                                n = '<i>' + n + '</i>';
                                            }
                    Severity: Major
                    Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

                      Method location_from has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def location_from(location, show_usage = false)
                                if location && !location.empty?
                                  if File.exist?(location)
                                    location
                                  else
                      Severity: Minor
                      Found in lib/pre-commit/checks/plugin/config_file.rb - About 45 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

                      Consider simplifying this complex logical expression.
                      Open

                                                  if (!nexttoken.identifier &&
                                                          nexttoken.id !== '"' &&
                                                          nexttoken.id !== '\'' &&
                                                          nexttoken.type !== '(string)' &&
                                                          nexttoken.type !== '(number)' &&
                      Severity: Major
                      Found in lib/pre-commit/support/jslint/lint.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                } else if (a === 'href' || a === 'background' ||
                                        a === 'content' || a === 'data' ||
                                        a.indexOf('src') >= 0 || a.indexOf('url') >= 0) {
                                    if (option.safe && ux.test(v)) {
                                        error("ADsafe URL violation.");
                        Severity: Major
                        Found in lib/pre-commit/support/jslint/lint.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                                              if ((c < '0' || c > '9') &&
                                                                      (c < 'a' || c > 'f') &&
                                                                      (c < 'A' || c > 'F')) {
                                                                  break;
                                                              }
                          Severity: Major
                          Found in lib/pre-commit/support/jslint/lint.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                            if (nexttoken.id === '=' || nexttoken.value === '~=' ||
                                                    nexttoken.value === '$=' ||
                                                    nexttoken.value === '|=' ||
                                                    nexttoken.id === '*=' ||
                                                    nexttoken.id === '^=') {
                            Severity: Major
                            Found in lib/pre-commit/support/jslint/lint.js - About 40 mins to fix

                              Function MediaQuery has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              function MediaQuery(modifier, mediaType, features, line, col){
                              Severity: Minor
                              Found in lib/pre-commit/support/csslint/csslint.js - About 35 mins to fix

                                Function createToken has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    createToken: function(tt, value, startLine, startCol, options){
                                Severity: Minor
                                Found in lib/pre-commit/support/csslint/csslint.js - About 35 mins to fix

                                  Function SelectorPart has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  function SelectorPart(elementName, modifiers, text, line, col){
                                  Severity: Minor
                                  Found in lib/pre-commit/support/csslint/csslint.js - About 35 mins to fix

                                    Method validate_params has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        def validate_params
                                          raise ArgumentError, "Missing name"               if name.nil?        || name.empty?
                                          raise ArgumentError, "Missing author"             if author.nil?      || author.empty?
                                          raise ArgumentError, "Missing email"              if email.nil?       || email.empty?
                                          raise ArgumentError, "Missing description"        if description.nil? || description.empty?
                                    Severity: Minor
                                    Found in lib/pre-commit/template.rb - About 35 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

                                    Method call has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                          def call(staged_files)
                                            migration_files = versioned_migration_files(staged_files)
                                            schema_files = versioned_schema_files(staged_files)
                                    
                                            if migration_files.any? && schema_files.none?
                                    Severity: Minor
                                    Found in lib/plugins/pre_commit/checks/migration.rb - About 35 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