jish/pre-commit

View on GitHub

Showing 259 of 259 total issues

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

                                if (CSSLint.Util.indexOf(propertyGroups[prop].actual, name.text) === -1) {
                                    propertyGroups[prop].actual.push(name.text);
                                    propertyGroups[prop].actualNodes.push(name);
                                }
    Severity: Major
    Found in lib/pre-commit/support/csslint/csslint.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if (CSSLint.Util.indexOf(actual, item) === -1) {
                                      propertiesSpecified = (actual.length === 1) ? actual[0] : (actual.length == 2) ? actual.join(" and ") : actual.join(", ");
                                      reporter.report("The property " + item + " is compatible with " + propertiesSpecified + " and should be included as well.", value.actualNodes[0].line, value.actualNodes[0].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

                                        if (t.length !== 4 && t.length !== 7) {
                                            warningAt("Bad hex color '{a}'.", line,
                                                from + l, t);
                                        }
        Severity: Major
        Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (left.value === 'Math') {
                                      warning("Math is not a function.", left);
                                  } else if (option.newcap) {
                                      warning(
          "Missing 'new' prefix when invoking a constructor.", left);
          Severity: Major
          Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (temp.length == 1){
                                        reader.reset();
                                    } else {
                                        value += temp;
                                    }
            Severity: Major
            Found in lib/pre-commit/support/csslint/csslint.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

                                            if (!propertyGroups[prop]) {
                                                propertyGroups[prop] = {
                                                    full : variations.slice(0),
                                                    actual : [],
                                                    actualNodes: []
                Severity: Major
                Found in lib/pre-commit/support/csslint/csslint.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (xmode === 'html') {
                                                  if (option.safe) {
                                                      warningAt("ADsafe string violation.",
                                                              line, character + j);
                                                  }
                  Severity: Major
                  Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (!option.on) {
                                                warning("Avoid HTML event handlers.");
                                            }
                    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 >= 0) {
                                                          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 (nexttoken.id === '%') {
                                                    advance('%');
                                                    if (number > 100) {
                                                        warning("Expected a percentage and instead saw '{a}'",
                                                            token, number);
                        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

                          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 (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

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

                                  rollupWarn: function(message, rule){
                                      this.messages.push({
                                          type    : "warning",
                                          rollup  : true,
                                          message : message,
                              Severity: Minor
                              Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 45 mins to fix
                              lib/pre-commit/support/csslint/csslint.js on lines 6795..6802

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

                              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 (c < ' ') {
                                                                          warningAt("Unexpected control character in regular expression.", line, from + l);
                                                                      } else if (c === '<') {
                                                                          warningAt("Unexpected escaped character '{a}' in regular expression.", line, from + l, c);
                                                                      }
                              Severity: Minor
                              Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 45 mins to fix
                              lib/pre-commit/support/jslint/lint.js on lines 1593..1597

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

                              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

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

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

                                                                                  if (c < ' ') {
                                                                                      warningAt("Unexpected control character in regular expression.", line, from + l);
                                                                                  } else if (c === '<') {
                                                                                      warningAt("Unexpected escaped character '{a}' in regular expression.", line, from + l, c);
                                                                                  }
                                  Severity: Minor
                                  Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 45 mins to fix
                                  lib/pre-commit/support/jslint/lint.js on lines 1511..1515

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

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language