jish/pre-commit

View on GitHub

Showing 259 of 259 total issues

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

            parseRule: function(input){
                this._tokenStream = new TokenStream(input, Tokens);

                //skip any leading white space
                this._readWhitespace();
Severity: Major
Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 2 hrs to fix
lib/pre-commit/support/csslint/csslint.js on lines 3482..3499

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

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

            parseSelector: function(input){

                this._tokenStream = new TokenStream(input, Tokens);

                //skip any leading white space
Severity: Major
Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 2 hrs to fix
lib/pre-commit/support/csslint/csslint.js on lines 3457..3473

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

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

    function statements(begin) {
        var a = [], f, p;
        if (begin && !use_strict() && option.strict) {
            warning('Missing "use strict" statement.', nexttoken);
        }
Severity: Major
Found in lib/pre-commit/support/jslint/lint.js - About 2 hrs to fix

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

        relation('!=', function (left, right) {
            if (option.eqeqeq) {
                warning("Expected '{a}' and instead saw '{b}'.",
                        this, '!==', '!=');
            } else if (isPoorRelation(left)) {
    Severity: Major
    Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 2 hrs to fix
    lib/pre-commit/support/jslint/lint.js on lines 4062..4074

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

    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

        relation('==', function (left, right) {
            if (option.eqeqeq) {
                warning("Expected '{a}' and instead saw '{b}'.",
                        this, '===', '==');
            } else if (isPoorRelation(left)) {
    Severity: Major
    Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 2 hrs to fix
    lib/pre-commit/support/jslint/lint.js on lines 4076..4088

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

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

        itself.data = function () {
    
            var data = {functions: []}, fu, globals, implieds = [], f, i, j,
                members = [], n, unused = [], v;
            if (itself.errors.length) {
    Severity: Major
    Found in lib/pre-commit/support/jslint/lint.js - About 2 hrs to fix

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

              if (expression.hasNext()) {
                  part = expression.next();
                  if (valid) {
                      throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
                  } else {
      Severity: Major
      Found in lib/pre-commit/support/csslint/csslint.js and 2 other locations - About 2 hrs to fix
      lib/pre-commit/support/csslint/csslint.js on lines 3669..3676
      lib/pre-commit/support/csslint/csslint.js on lines 3709..3716

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

      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 (nexttoken.id !== ';') {
                  if (token.line === nexttoken.line) {
                      if (funct[v] !== 'label') {
                          warning("'{a}' is not a statement label.", nexttoken, v);
                      } else if (scope[v] !== funct) {
      Severity: Major
      Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 2 hrs to fix
      lib/pre-commit/support/jslint/lint.js on lines 4966..4978

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

      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 (nexttoken.id !== ';') {
                  if (token.line === nexttoken.line) {
                      if (funct[v] !== 'label') {
                          warning("'{a}' is not a statement label.", nexttoken, v);
                      } else if (scope[v] !== funct) {
      Severity: Major
      Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 2 hrs to fix
      lib/pre-commit/support/jslint/lint.js on lines 4944..4954

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

      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

              if (expression.hasNext()) {
                  part = expression.next();
                  if (valid) {
                      throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
                  } else {
      Severity: Major
      Found in lib/pre-commit/support/csslint/csslint.js and 2 other locations - About 2 hrs to fix
      lib/pre-commit/support/csslint/csslint.js on lines 3599..3606
      lib/pre-commit/support/csslint/csslint.js on lines 3669..3676

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

      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

              if (expression.hasNext()) {
                  part = expression.next();
                  if (valid) {
                      throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
                  } else {
      Severity: Major
      Found in lib/pre-commit/support/csslint/csslint.js and 2 other locations - About 2 hrs to fix
      lib/pre-commit/support/csslint/csslint.js on lines 3599..3606
      lib/pre-commit/support/csslint/csslint.js on lines 3709..3716

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

      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

      Consider simplifying this complex logical expression.
      Open

                                  if ((i.id === '(number)' && /[.+\-Ee]/.test(i.value)) ||
                                          (i.id === '-' && !i.right) ||
                                          i.id === '(string)' || i.id === '[' ||
                                          i.id === '{' || i.id === 'true' ||
                                          i.id === 'false' ||
      Severity: Critical
      Found in lib/pre-commit/support/jslint/lint.js - About 2 hrs to fix

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

                        } else if (t.value === 'maxerr' && o === '/*jslint') {
                            b = +v.value;
                            if (typeof b !== 'number' || !isFinite(b) || b <= 0 ||
                                    Math.floor(b) !== b) {
                                error("Expected a small integer and instead saw '{a}'.",
        Severity: Major
        Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 2 hrs to fix
        lib/pre-commit/support/jslint/lint.js on lines 1882..1896

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

        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

                        } else if (t.value === 'maxlen' && o === '/*jslint') {
                            b = +v.value;
                            if (typeof b !== 'number' || !isFinite(b) || b <= 0 ||
                                    Math.floor(b) !== b) {
                                error("Expected a small integer and instead saw '{a}'.",
        Severity: Major
        Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 2 hrs to fix
        lib/pre-commit/support/jslint/lint.js on lines 1874..1896

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

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

            infix('(', function (left, that) {
                adjacent(prevtoken, token);
                nospace();
                var n = 0,
                    p = [];
        Severity: Major
        Found in lib/pre-commit/support/jslint/lint.js - About 2 hrs to fix

          Function styleValue has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function styleValue(v) {
                  var i = 0,
                      n,
                      once,
                      match,
          Severity: Major
          Found in lib/pre-commit/support/jslint/lint.js - About 2 hrs to fix

            Function doAttribute has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function doAttribute(n, a, v) {
                    var u, x;
                    if (a === 'id') {
                        u = typeof v === 'string' ? v.toUpperCase() : '';
                        if (ids[u] === true) {
            Severity: Major
            Found in lib/pre-commit/support/jslint/lint.js - About 2 hrs to fix

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

                  function cssColor() {
                      var i, number, value;
                      if (nexttoken.identifier) {
                          value = nexttoken.value;
                          if (value === 'rgb' || value === 'rgba') {
              Severity: Major
              Found in lib/pre-commit/support/jslint/lint.js - About 2 hrs to fix

                Function nud has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        x.nud = function () {
                            var b, i, s, seen = {};
                            b = token.line !== nexttoken.line;
                            if (b) {
                                indent += option.indent;
                Severity: Major
                Found in lib/pre-commit/support/jslint/lint.js - About 2 hrs to fix

                  Function <bg-position></bg-position> has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          "<bg-position>": function(expression){
                              var types   = this,
                                  result  = false,
                                  numeric = "<percentage> | <length>",
                                  xDir    = "left | right",
                  Severity: Major
                  Found in lib/pre-commit/support/csslint/csslint.js - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language