jish/pre-commit

View on GitHub

Showing 259 of 259 total issues

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

        if (b) {
            indent += option.indent;
            if (nexttoken.from === indent + option.indent) {
                indent += option.indent;
            }
Severity: Minor
Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 50 mins to fix
lib/pre-commit/support/jslint/lint.js on lines 4456..4461

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

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 3 locations. Consider refactoring.
Open

                                        case Tokens.NAMESPACE_SYM:
                                            token = tokenStream.LT(1);
                                            this._namespace(false);
                                            throw new SyntaxError("@namespace not allowed here.", token.startLine, token.startCol);
Severity: Major
Found in lib/pre-commit/support/csslint/csslint.js and 2 other locations - About 50 mins to fix
lib/pre-commit/support/csslint/csslint.js on lines 1422..1425
lib/pre-commit/support/csslint/csslint.js on lines 1426..1429

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

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 3 locations. Consider refactoring.
Open

                                        case Tokens.CHARSET_SYM:
                                            token = tokenStream.LT(1);
                                            this._charset(false);
                                            throw new SyntaxError("@charset not allowed here.", token.startLine, token.startCol);
Severity: Major
Found in lib/pre-commit/support/csslint/csslint.js and 2 other locations - About 50 mins to fix
lib/pre-commit/support/csslint/csslint.js on lines 1426..1429
lib/pre-commit/support/csslint/csslint.js on lines 1430..1433

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

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 3 locations. Consider refactoring.
Open

                                        case Tokens.IMPORT_SYM:
                                            token = tokenStream.LT(1);
                                            this._import(false);
                                            throw new SyntaxError("@import not allowed here.", token.startLine, token.startCol);
Severity: Major
Found in lib/pre-commit/support/csslint/csslint.js and 2 other locations - About 50 mins to fix
lib/pre-commit/support/csslint/csslint.js on lines 1422..1425
lib/pre-commit/support/csslint/csslint.js on lines 1430..1433

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

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 (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 (ValidationTypes.isAny(expression, xDir)) {
                                    result = true;
                                    ValidationTypes.isAny(expression, numeric);
                            } else if (ValidationTypes.isAny(expression, "center")) {
                                result = true;
    Severity: Major
    Found in lib/pre-commit/support/csslint/csslint.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if (!lastProperty || (lastProperty.property.text.toLowerCase() != name || lastProperty.colorType != "compat")){
                                      reporter.report("Fallback " + name + " (hex or RGB) should precede " + colorType + " " + name + ".", event.line, event.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 (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 (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

                                } else if (a === 'style') {
                                    xmode = 'scriptstring';
                                    advance('=');
                                    q = nexttoken.id;
                                    if (q !== '"' && q !== "'") {
            Severity: Major
            Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if (!(prop == "padding" && value.parts.length === 2 && value.parts[1].value === 0)){
                                              reporter.report("Using width with " + prop + " can sometimes make elements larger than you expect.", properties[prop].line, properties[prop].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(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 (nexttoken.id !== q) {
                                              error("Missing close quote on script attribute.");
                                          }
                  Severity: Major
                  Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if (!nextLine()) {
                                                        errorAt("Unclosed comment.", line, character);
                                                    } else {
                                                        if (option.safe && ax.test(s)) {
                                                            warningAt("ADsafe comment violation.", line, character);
                    Severity: Major
                    Found in lib/pre-commit/support/jslint/lint.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                      for (;;) {
                                                          b = true;
                                                          c = s.charAt(l);
                                                          l += 1;
                                                          switch (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 (combinator !== null){
                                                            selector.push(combinator);
                                                        } else {
                                                            selector.push(ws);
                                                        }
                        Severity: Major
                        Found in lib/pre-commit/support/csslint/csslint.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if (ValidationTypes.isAny(expression, xDir + " | " + yDir)) {
                                                  result = true;
                                                  ValidationTypes.isAny(expression, numeric);
                                              }
                          Severity: Major
                          Found in lib/pre-commit/support/csslint/csslint.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 (!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 (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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language