jish/pre-commit

View on GitHub

Showing 171 of 259 total issues

Function _attrib has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            _attrib: function(){
                /*
                 * attrib
                 *   : '[' S* [ namespace_prefix ]? IDENT S*
                 *         [ [ PREFIXMATCH |
Severity: Minor
Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

    Function warning has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function warning(m, t, a, b, c, d) {
            var ch, l, w;
            t = t || nexttoken;
            if (t.id === '(end)') {  // `~
                t = token;
    Severity: Minor
    Found in lib/pre-commit/support/jslint/lint.js - About 1 hr to fix

      Function endRule has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function endRule(){
      
                  var display = properties.display ? properties.display.value : null;
                  if (display){
                      switch(display){
      Severity: Minor
      Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

        Function styles has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function styles() {
                var i;
                while (nexttoken.id === '@') {
                    i = peek();
                    if (i.identifier && i.value === 'import') {
        Severity: Minor
        Found in lib/pre-commit/support/jslint/lint.js - About 1 hr to fix

          Function border-radius has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              "border-radius"                 : function(expression) {
          
                  var valid   = false,
                      simple = "<length> | <percentage> | inherit",
                      slash   = false,
          Severity: Minor
          Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

            Function _namespace has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        _namespace: function(emit){
                            /*
                             * namespace
                             *   : NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S*
                             */
            Severity: Minor
            Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

              Function unicodeRangeToken has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  unicodeRangeToken: function(first, startLine, startCol){
                      var reader  = this._reader,
                          value   = first,
                          temp,
                          tt      = Tokens.CHAR;
              Severity: Minor
              Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

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

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

                    Function <shadow></shadow> has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            "<shadow>": function(expression) {
                                //inset? && [ <length>{2,4} && <color>? ]
                                var result  = false,
                                    count   = 0,
                                    inset   = false,
                    Severity: Minor
                    Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

                      Function readURI has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          readURI: function(first){
                              var reader  = this._reader,
                                  uri     = first,
                                  inner   = "",
                                  c       = reader.peek();
                      Severity: Minor
                      Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

                        Function numberToken has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            numberToken: function(first, startLine, startCol){
                                var reader  = this._reader,
                                    value   = this.readNumber(first),
                                    ident,
                                    tt      = Tokens.NUMBER,
                        Severity: Minor
                        Found in lib/pre-commit/support/csslint/csslint.js - About 1 hr to fix

                          Function cssUrl has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function cssUrl() {
                                  var c, url;
                                  if (nexttoken.identifier && nexttoken.value === 'url') {
                                      nexttoken = lex.range('(', ')');
                                      url = nexttoken.value;
                          Severity: Minor
                          Found in lib/pre-commit/support/jslint/lint.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                        if (!left.identifier && left.id !== '.' && left.id !== '[' &&
                                                left.id !== '(' && left.id !== '&&' && left.id !== '||' &&
                                                left.id !== '?') {
                                            warning("Bad invocation.", left);
                                        }
                            Severity: Major
                            Found in lib/pre-commit/support/jslint/lint.js - About 1 hr to fix

                              Method call has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                    def call(staged_files)
                                      staged_files = files_filter(staged_files)
                                      return if staged_files.empty?
                              
                                      result =
                              Severity: Minor
                              Found in lib/pre-commit/checks/grep.rb - About 55 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

                              Function errorAt has 7 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  function errorAt(m, l, ch, a, b, c, d) {
                              Severity: Major
                              Found in lib/pre-commit/support/jslint/lint.js - About 50 mins to fix

                                Function warningAt has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    function warningAt(m, l, ch, a, b, c, d) {
                                Severity: Major
                                Found in lib/pre-commit/support/jslint/lint.js - About 50 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 (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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language