ericduran/chromeHAR

View on GitHub

Showing 463 of 463 total issues

Function extractComments has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

function extractComments(source) {
  var index = 0, length = source.length, results = [], symbol, position, original;
  while (index < length) {
    symbol = source[index];
    switch (symbol) {
Severity: Minor
Found in bower_components/json3/build.js - About 4 hrs 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

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

  if (attr.ngMaxlength) {
    var maxlength = int(attr.ngMaxlength);
    var maxLengthValidator = function(value) {
      if (!isEmpty(value) && value.length > maxlength) {
        ctrl.$setValidity('maxlength', false);
Severity: Major
Found in bower_components/angular/angular.js and 1 other location - About 4 hrs to fix
bower_components/angular/angular.js on lines 11825..11839

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

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 (attr.ngMinlength) {
    var minlength = int(attr.ngMinlength);
    var minLengthValidator = function(value) {
      if (!isEmpty(value) && value.length < minlength) {
        ctrl.$setValidity('minlength', false);
Severity: Major
Found in bower_components/angular/angular.js and 1 other location - About 4 hrs to fix
bower_components/angular/angular.js on lines 11842..11856

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

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

function $LocationProvider(){
  var hashPrefix = '',
      html5Mode = false;

  /**
Severity: Major
Found in bower_components/angular/angular.js - About 4 hrs to fix

    Function lex has 104 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          var lex = function () {
            var source = Source, length = source.length, value, begin, position, isSigned, charCode;
            while (Index < length) {
              charCode = source.charCodeAt(Index);
              switch (charCode) {
    Severity: Major
    Found in bower_components/json3/lib/json3.js - About 4 hrs to fix

      Function publishExternalAPI has 103 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function publishExternalAPI(angular){
        extend(angular, {
          'bootstrap': bootstrap,
          'copy': copy,
          'extend': extend,
      Severity: Major
      Found in bower_components/angular/angular.js - About 4 hrs to fix

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

            contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
                function( a, b ) {
                    var adown = a.nodeType === 9 ? a.documentElement : a,
                        bup = b && b.parentNode;
                    return a === bup || !!( bup && bup.nodeType === 1 && (
        Severity: Major
        Found in bower_components/jquery/jquery.js and 1 other location - About 4 hrs to fix
        bower_components/angular/angular.js on lines 2138..2157

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

        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

                  var contains = document.body.contains || document.body.compareDocumentPosition ?
                  function( a, b ) {
                    var adown = a.nodeType === 9 ? a.documentElement : a,
                    bup = b && b.parentNode;
                    return a === bup || !!( bup && bup.nodeType === 1 && (
        Severity: Major
        Found in bower_components/angular/angular.js and 1 other location - About 4 hrs to fix
        bower_components/jquery/jquery.js on lines 1535..1554

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

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

            function ResourceFactory(url, paramDefaults, actions) {
              var route = new Route(url);
        
              actions = extend({}, DEFAULT_ACTIONS, actions);
        
        
        Severity: Major
        Found in bower_components/angular-resource/angular-resource.js - About 4 hrs to fix

          File html5.js has 330 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
           * HTML5.js v1.0.0-rc
           * Copyright 2012 John-David Dalton <http://allyoucanleet.com/>
           * Based on HTML5 Shiv vpre3.3 | @afarkas @jon_neal @rem | MIT/GPL2 Licensed
           * Available under MIT/GPL2 license
          Severity: Minor
          Found in bower_components/json3/benchmark/assets/html5.js - About 3 hrs to fix

            Function nodeLinkFn has 96 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
                    var attrs, $element, i, ii, linkFn, controller;
            
                    if (compileNode === linkNode) {
                      attrs = templateAttrs;
            Severity: Major
            Found in bower_components/angular/angular.js - About 3 hrs to fix

              Function defaultPrefilter has 93 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function defaultPrefilter( elem, props, opts ) {
                  /* jshint validthis: true */
                  var prop, value, toggle, tween, hooks, oldfire,
                      anim = this,
                      orig = {},
              Severity: Major
              Found in bower_components/jquery/jquery.js - About 3 hrs to fix

                Function textInputType has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
                
                  var listener = function() {
                    var value = trim(element.val());
                
                
                Severity: Major
                Found in bower_components/angular/angular.js - About 3 hrs to fix

                  Function TzDate has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    angular.mock.TzDate = function (offset, timestamp) {
                      var self = new Date(0);
                      if (angular.isString(timestamp)) {
                        var tsStr = timestamp;
                  
                  
                  Severity: Major
                  Found in bower_components/angular-mocks/angular-mocks.js - About 3 hrs to fix

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

                    function padNumber(num, digits, trim) {
                      var neg = '';
                      if (num < 0) {
                        neg =  '-';
                        num = -num;
                    Severity: Major
                    Found in bower_components/angular/angular.js and 1 other location - About 3 hrs to fix
                    bower_components/angular-mocks/angular-mocks.js on lines 436..447

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

                    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

                      function padNumber(num, digits, trim) {
                        var neg = '';
                        if (num < 0) {
                          neg =  '-';
                          num = -num;
                    Severity: Major
                    Found in bower_components/angular-mocks/angular-mocks.js and 1 other location - About 3 hrs to fix
                    bower_components/angular/angular.js on lines 10154..10165

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

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

                      compile: function(element, attr, linker) {
                        return function(scope, iterStartElement, attr){
                          var expression = attr.ngRepeat;
                          var match = expression.match(/^\s*(.+)\s+in\s+(.*)\s*$/),
                            lhs, rhs, valueIdent, keyIdent;
                    Severity: Major
                    Found in bower_components/angular/angular.js - About 3 hrs to fix

                      Function $CacheFactoryProvider has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function $CacheFactoryProvider() {
                      
                        this.$get = function() {
                          var caches = {};
                      
                      
                      Severity: Major
                      Found in bower_components/angular/angular.js - About 3 hrs to fix

                        Function $get has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          this.$get = function() {
                            var caches = {};
                        
                            function cacheFactory(cacheId, options) {
                              if (cacheId in caches) {
                        Severity: Major
                        Found in bower_components/angular/angular.js - About 3 hrs to fix

                          Function NgModelController has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function($scope, $exceptionHandler, $attr, $element, $parse) {
                            this.$viewValue = Number.NaN;
                            this.$modelValue = Number.NaN;
                            this.$parsers = [];
                            this.$formatters = [];
                          Severity: Major
                          Found in bower_components/angular/angular.js - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language