jish/pre-commit

View on GitHub

Showing 259 of 259 total issues

Function JSLINT has a Cognitive Complexity of 2493 (exceeds 5 allowed). Consider refactoring.
Open

var JSLINT = (function () {
    var adsafe_id,      // The widget's ADsafe id.
        adsafe_may,     // The widget may load approved scripts.
        adsafe_went,    // ADSAFE.go has been called.
        anonname,       // The guessed name for anonymous functions.
Severity: Minor
Found in lib/pre-commit/support/jslint/lint.js - About 1 mo 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 CSSLint has 5384 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var CSSLint = (function(){
/*!
Parser-Lib
Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved.

Severity: Major
Found in lib/pre-commit/support/csslint/csslint.js - About 3 wks to fix

    Function JSLINT has 4801 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var JSLINT = (function () {
        var adsafe_id,      // The widget's ADsafe id.
            adsafe_may,     // The widget may load approved scripts.
            adsafe_went,    // ADSAFE.go has been called.
            anonname,       // The guessed name for anonymous functions.
    Severity: Major
    Found in lib/pre-commit/support/jslint/lint.js - About 3 wks to fix

      File csslint.js has 5387 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*!
      CSSLint
      Copyright (c) 2013 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
      
      Permission is hereby granted, free of charge, to any person obtaining a copy
      Severity: Major
      Found in lib/pre-commit/support/csslint/csslint.js - About 2 wks to fix

        File lint.js has 4804 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // jslint.js
        // 2010-02-20
        
        /*
        Copyright (c) 2002 Douglas Crockford  (www.JSLint.com)
        Severity: Major
        Found in lib/pre-commit/support/jslint/lint.js - About 1 wk to fix

          Function prototype has 1270 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Parser.prototype = function(){
          
              var proto = new EventTarget(),  //new prototype
                  prop,
                  additions =  {
          Severity: Major
          Found in lib/pre-commit/support/csslint/csslint.js - About 6 days to fix

            Function CSSLint has a Cognitive Complexity of 247 (exceeds 5 allowed). Consider refactoring.
            Open

            var CSSLint = (function(){
            /*!
            Parser-Lib
            Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved.
            
            
            Severity: Minor
            Found in lib/pre-commit/support/csslint/csslint.js - About 5 days 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 lex has 662 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var lex = (function lex() {
                    var character, from, line, s;
            
            // Private lex methods
            
            
            Severity: Major
            Found in lib/pre-commit/support/jslint/lint.js - About 3 days to fix

              Function token has 556 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          token: function () {
                              var b, c, captures, d, depth, high, i, l, low, q, t;
              
                              function match(x) {
                                  var r = x.exec(s), r1;
              Severity: Major
              Found in lib/pre-commit/support/jslint/lint.js - About 2 days to fix

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

                CSSLint.addFormatter({
                    //format information
                    id: "lint-xml",
                    name: "Lint XML format",
                
                
                Severity: Major
                Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 2 days to fix
                lib/pre-commit/support/csslint/csslint.js on lines 8953..9019

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

                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

                CSSLint.addFormatter({
                    //format information
                    id: "csslint-xml",
                    name: "CSSLint XML format",
                
                
                Severity: Major
                Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 2 days to fix
                lib/pre-commit/support/csslint/csslint.js on lines 9126..9193

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

                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

                                        do {
                
                                            if (this._readWhitespace()){
                                                functionText += tokenStream.token().value;
                                            }
                Severity: Major
                Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 1 day to fix
                lib/pre-commit/support/csslint/csslint.js on lines 3021..3045

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

                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

                                    do {
                
                                        if (this._readWhitespace()){
                                            functionText += tokenStream.token().value;
                                        }
                Severity: Major
                Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 1 day to fix
                lib/pre-commit/support/csslint/csslint.js on lines 2967..2991

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

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

                    function html() {
                        var a, attributes, e, n, q, t, v, w = option.white, wmode;
                        xmode = 'html';
                        xquote = '';
                        stack = null;
                Severity: Major
                Found in lib/pre-commit/support/jslint/lint.js - About 7 hrs to fix

                  Function init has 152 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      init: function (parser, reporter) {
                          var rule = this,
                              compatiblePrefixes,
                              properties,
                              prop,
                  Severity: Major
                  Found in lib/pre-commit/support/csslint/csslint.js - About 6 hrs to fix

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

                    CSSLint.addRule({
                    
                        //rule information
                        id: "selector-max-approaching",
                        name: "Warn when approaching the 4095 selector limit for IE",
                    Severity: Major
                    Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 5 hrs to fix
                    lib/pre-commit/support/csslint/csslint.js on lines 8238..8261

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

                    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

                    CSSLint.addRule({
                    
                        //rule information
                        id: "selector-max",
                        name: "Error when past the 4095 selector limit for IE",
                    Severity: Major
                    Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 5 hrs to fix
                    lib/pre-commit/support/csslint/csslint.js on lines 8209..8232

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

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

                        var itself = function (s, o) {
                            var a, i;
                            JSLINT.errors = [];
                            predefined = Object.create(standard);
                            if (o) {
                    Severity: Major
                    Found in lib/pre-commit/support/jslint/lint.js - About 5 hrs to fix

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

                      CSSLint.addRule({
                      
                          //rule information
                          id: "underscore-property-hack",
                          name: "Disallow properties with an underscore prefix",
                      Severity: Major
                      Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 5 hrs to fix
                      lib/pre-commit/support/csslint/csslint.js on lines 8354..8375

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

                      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

                      CSSLint.addRule({
                      
                          //rule information
                          id: "star-property-hack",
                          name: "Disallow properties with a star prefix",
                      Severity: Major
                      Found in lib/pre-commit/support/csslint/csslint.js and 1 other location - About 5 hrs to fix
                      lib/pre-commit/support/csslint/csslint.js on lines 8434..8455

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

                      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