jish/pre-commit

View on GitHub

Showing 259 of 259 total issues

Function jsonObject has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function jsonObject() {
            var o = {}, t = nexttoken;
            advance('{');
            if (nexttoken.id !== '}') {
                for (;;) {
Severity: Minor
Found in lib/pre-commit/support/jslint/lint.js - About 1 hr to fix

    Function _media has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                _media: function(){
                    /*
                     * media
                     *   : MEDIA_SYM S* media_query_list S* '{' S* ruleset* '}' S*
                     *   ;
    Severity: Minor
    Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

      Function _function has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  _function: function(){
      
                      /*
                       * function
                       *   : FUNCTION S* expr ')' S*
      Severity: Minor
      Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

        Function _page has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    _page: function(){
                        /*
                         * page:
                         *    PAGE_SYM S* IDENT? pseudo_page? S*
                         *    '{' S* [ declaration | margin ]? [ ';' S* [ declaration | margin ]? ]* '}' S*
        Severity: Minor
        Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

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

                  parser.addListener("endstylesheet", function(){
                      reporter.stat("font-sizes", count);
                      if (count >= 10){
                          reporter.rollupWarn("Too many font-size declarations (" + count + "), abstraction needed.", rule);
                      }
          Severity: Major
          Found in lib/pre-commit/support/csslint/csslint.js and 2 other locations - About 1 hr to fix
          lib/pre-commit/support/csslint/csslint.js on lines 7681..7686
          lib/pre-commit/support/csslint/csslint.js on lines 7921..7926

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

          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 (adsafe_id) {
                              if (v.slice(0, adsafe_id.length) !== adsafe_id) {
                                  warning("ADsafe violation: An id must have a '{a}' prefix",
                                          nexttoken, adsafe_id);
                              } else if (!/^[A-Z]+_[A-Z]+$/.test(v)) {
          Severity: Major
          Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 1 hr to fix
          lib/pre-commit/support/jslint/lint.js on lines 3515..3527

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

          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

                  parser.addListener("endstylesheet", function(){
                      reporter.stat("important", count);
                      if (count >= 10){
                          reporter.rollupWarn("Too many !important declarations (" + count + "), try to use less than 10 to avoid specificity issues.", rule);
                      }
          Severity: Major
          Found in lib/pre-commit/support/csslint/csslint.js and 2 other locations - About 1 hr to fix
          lib/pre-commit/support/csslint/csslint.js on lines 7681..7686
          lib/pre-commit/support/csslint/csslint.js on lines 7746..7751

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

          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 (adsafe_id) {
                              if (v.slice(0, adsafe_id.length) !== adsafe_id) {
                                  warning("ADsafe violation: An id must have a '{a}' prefix",
                                          nexttoken, adsafe_id);
                              } else if (!/^[A-Z]+_[A-Z]+$/.test(v)) {
          Severity: Major
          Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 1 hr to fix
          lib/pre-commit/support/jslint/lint.js on lines 3549..3558

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

          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

                  parser.addListener("endstylesheet", function(){
                      reporter.stat("floats", count);
                      if (count >= 10){
                          reporter.rollupWarn("Too many floats (" + count + "), you're probably using them for layout. Consider using a grid system instead.", rule);
                      }
          Severity: Major
          Found in lib/pre-commit/support/csslint/csslint.js and 2 other locations - About 1 hr to fix
          lib/pre-commit/support/csslint/csslint.js on lines 7746..7751
          lib/pre-commit/support/csslint/csslint.js on lines 7921..7926

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

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

              init: function(parser, reporter){
                  var rule = this,
                      count = 0,
                      fontFaceRule = false,
                      firstSrc     = true,
          Severity: Minor
          Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

            Function formatResults has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                formatResults: function(results, filename, options) {
            
                    var messages = results.messages,
                        output = [],
                        tests = {
            Severity: Minor
            Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

              Function block has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function block(f) {
                      var a, b = inblock, old_indent = indent, s = scope, t;
                      inblock = f;
                      scope = Object.create(scope);
                      nonadjacent(token, nexttoken);
              Severity: Minor
              Found in lib/pre-commit/support/jslint/lint.js - About 1 hr to fix

                Method to_s has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    def to_s
                      result = message.to_s
                      unless empty? file
                        result = "#{result}#{"\n" unless empty?(result)}#{file}"
                        result = "#{result}:#{line}" unless empty? line
                Severity: Minor
                Found in lib/pre-commit/line.rb - About 1 hr 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 border-image-slice has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    "border-image-slice"            : function(expression) {
                
                        var valid   = false,
                            numeric = "<number> | <percentage>",
                            fill    = false,
                Severity: Minor
                Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

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

                                                          if (xmode === 'script') {
                                                              c = s.charAt(l);
                                                              if (c === '!' || c === '/') {
                                                                  warningAt("HTML confusion in regular expression '<{a}'.", line, from + l, c);
                                                              }
                  Severity: Major
                  Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 1 hr to fix
                  lib/pre-commit/support/jslint/lint.js on lines 1606..1611

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

                  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 (xmode === 'script') {
                                                                      c = s.charAt(l);
                                                                      if (c === '!' || c === '/') {
                                                                          warningAt("HTML confusion in regular expression '<{a}'.", line, from + l, c);
                                                                      }
                  Severity: Major
                  Found in lib/pre-commit/support/jslint/lint.js and 1 other location - About 1 hr to fix
                  lib/pre-commit/support/jslint/lint.js on lines 1633..1638

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

                  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

                  module PreCommit
                    module Checks
                      class ScssLint < Shell
                  
                        def call(staged_files)
                  Severity: Major
                  Found in lib/plugins/pre_commit/checks/scss_lint.rb and 1 other location - About 1 hr to fix
                  lib/plugins/pre_commit/checks/coffeelint.rb on lines 3..29

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

                  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

                  module PreCommit
                    module Checks
                      class Coffeelint < Shell
                  
                        def call(staged_files)
                  Severity: Major
                  Found in lib/plugins/pre_commit/checks/coffeelint.rb and 1 other location - About 1 hr to fix
                  lib/plugins/pre_commit/checks/scss_lint.rb on lines 3..29

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

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

                      init: function(parser, reporter){
                          var rule = this;
                          parser.addListener("startrule", function(event){
                              var selectors = event.selectors,
                                  selector,
                  Severity: Minor
                  Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

                    Function _ie_function has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                _ie_function: function(){
                    
                                    /* (My own extension)
                                     * ie_function
                                     *   : IE_FUNCTION S* IDENT '=' term [S* ','? IDENT '=' term]+ ')' S*
                    Severity: Minor
                    Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language