ericduran/chromeHAR

View on GitHub

Showing 463 of 463 total issues

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

    function encodeUriQuery(val, pctEncodeSpaces) {
      return encodeURIComponent(val).
        replace(/%40/gi, '@').
        replace(/%3A/gi, ':').
        replace(/%24/g, '$').
Severity: Major
Found in bower_components/angular-resource/angular-resource.js and 1 other location - About 1 hr to fix
bower_components/angular/angular.js on lines 928..935

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

Consider simplifying this complex logical expression.
Open

      if (t==e1 || t==e2 || t==e3 || t==e4 ||
          (!e1 && !e2 && !e3 && !e4)) {
        return token;
      }
Severity: Critical
Found in bower_components/angular/angular.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (type == 'mouseenter' || type == 'mouseleave') {
              var contains = document.body.contains || document.body.compareDocumentPosition ?
              function( a, b ) {
                var adown = a.nodeType === 9 ? a.documentElement : a,
                bup = b && b.parentNode;
    Severity: Critical
    Found in bower_components/angular/angular.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                              } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
                                  diff = cache[1];
      
                              // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
                              } else {
      Severity: Critical
      Found in bower_components/jquery/jquery.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                    if ( start && start[ 3 ] !== unit ) {
                        // Trust units reported by jQuery.css
                        unit = unit || start[ 3 ];
        
                        // Make sure we update the tween properties later on
        Severity: Critical
        Found in bower_components/jquery/jquery.js - About 1 hr to fix

          Function copy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function copy(source, destination){
            if (isWindow(source) || isScope(source)) throw Error("Can't copy Window or Scope");
            if (!destination) {
              destination = source;
              if (source) {
          Severity: Minor
          Found in bower_components/angular/angular.js - About 1 hr to fix

            Function compile has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                compile: function(element, attr) {
                  var srcExp = attr.ngInclude || attr.src,
                      onloadExp = attr.onload || '',
                      autoScrollExp = attr.autoscroll;
            
            
            Severity: Minor
            Found in bower_components/angular/angular.js - About 1 hr to fix

              Function setOffset has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  setOffset: function( elem, options, i ) {
                      var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
                          position = jQuery.css( elem, "position" ),
                          curElem = jQuery( elem ),
                          props = {};
              Severity: Minor
              Found in bower_components/jquery/jquery.js - About 1 hr to fix

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

                        if ( jQuery.isFunction( value ) ) {
                            return this.each(function( j ) {
                                jQuery( this ).addClass( value.call( this, j, this.className ) );
                            });
                        }
                Severity: Major
                Found in bower_components/jquery/jquery.js and 1 other location - About 1 hr to fix
                bower_components/jquery/jquery.js on lines 3869..3873

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

                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

                        if ( jQuery.isFunction( value ) ) {
                            return this.each(function( j ) {
                                jQuery( this ).removeClass( value.call( this, j, this.className ) );
                            });
                        }
                Severity: Major
                Found in bower_components/jquery/jquery.js and 1 other location - About 1 hr to fix
                bower_components/jquery/jquery.js on lines 3830..3834

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

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

                   this.directive = function registerDirective(name, directiveFactory) {
                    if (isString(name)) {
                      assertArg(directiveFactory, 'directive');
                      if (!hasDirectives.hasOwnProperty(name)) {
                        hasDirectives[name] = [];
                Severity: Minor
                Found in bower_components/angular/angular.js - About 1 hr to fix

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

                    form.$setValidity = function(validationToken, isValid, control) {
                      var queue = errors[validationToken];
                  
                      if (isValid) {
                        if (queue) {
                  Severity: Minor
                  Found in bower_components/angular/angular.js - About 1 hr to fix

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

                      function getType(ct, url) {
                        if (ct === undefined) {
                          return 'oth';
                        }
                        ct = ct.toLowerCase();
                    Severity: Minor
                    Found in js/controllers.js - About 1 hr to fix

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

                      jQuery.fn.load = function( url, params, callback ) {
                          if ( typeof url !== "string" && _load ) {
                              return _load.apply( this, arguments );
                          }
                      
                      
                      Severity: Minor
                      Found in bower_components/jquery/jquery.js - About 1 hr to fix

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

                                Array.prototype.splice = function(start, deleteCount) {
                                    var result
                                        , args = _Array_slice_.call(arguments, 2)
                                        , addElementsCount = args.length
                                    ;
                        Severity: Minor
                        Found in bower_components/es5-shim/es5-shim.js - About 1 hr to fix

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

                              style: function( elem, name, value, extra ) {
                                  // Don't set styles on text and comment nodes
                                  if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                                      return;
                                  }
                          Severity: Minor
                          Found in bower_components/jquery/jquery.js - About 1 hr to fix

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

                                Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
                                    if ((typeof object != "object" && typeof object != "function") || object === null) {
                                        throw new TypeError(ERR_NON_OBJECT + object);
                                    }
                            
                            
                            Severity: Minor
                            Found in bower_components/es5-shim/es5-sham.js - About 1 hr to fix

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

                                  Array.prototype.reduce = function reduce(fun /*, initial*/) {
                                      var object = toObject(this),
                                          self = splitString && _toString(this) == "[object String]" ?
                                              this.split("") :
                                              object,
                              Severity: Minor
                              Found in bower_components/es5-shim/es5-shim.js - About 1 hr to fix

                                Function UIString has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                WebInspector.UIString = function(string, vararg)
                                {
                                    if (Preferences.localizeUI) {
                                        if (window.localizedStrings && string in window.localizedStrings)
                                            string = window.localizedStrings[string];
                                Severity: Minor
                                Found in js/libs/devTools.js - 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 primary has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  function primary() {
                                    var primary;
                                    if (expect('(')) {
                                      primary = filterChain();
                                      consume(')');
                                Severity: Minor
                                Found in bower_components/angular/angular.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language