angular/angular.js

View on GitHub
src/ng/compile.js

Summary

Maintainability
F
2 mos
Test Coverage

Function $CompileProvider has a Cognitive Complexity of 1149 (exceeds 5 allowed). Consider refactoring.
Open

function $CompileProvider($provide, $$sanitizeUriProvider) {
  var hasDirectives = {},
      Suffix = 'Directive',
      COMMENT_DIRECTIVE_REGEXP = /^\s*directive:\s*([\w-]+)\s+(.*)$/,
      CLASS_DIRECTIVE_REGEXP = /(([\w-]+)(?::([^;]+))?;?)/,
Severity: Minor
Found in src/ng/compile.js - About 3 wks 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 $CompileProvider has 1774 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function $CompileProvider($provide, $$sanitizeUriProvider) {
  var hasDirectives = {},
      Suffix = 'Directive',
      COMMENT_DIRECTIVE_REGEXP = /^\s*directive:\s*([\w-]+)\s+(.*)$/,
      CLASS_DIRECTIVE_REGEXP = /(([\w-]+)(?::([^;]+))?;?)/,
Severity: Major
Found in src/ng/compile.js - About 1 wk to fix

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

        function($injector,   $interpolate,   $exceptionHandler,   $templateRequest,   $parse,
                 $controller,   $rootScope,   $sce,   $animate) {
    
        var SIMPLE_ATTR_NAME = /^\w/;
        var specialAttrHolder = window.document.createElement('div');
    Severity: Major
    Found in src/ng/compile.js - About 1 wk to fix

      File compile.js has 1828 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
       *     Any commits to this file should be reviewed with security in mind.  *
       *   Changes to this file can potentially create security vulnerabilities. *
      Severity: Major
      Found in src/ng/compile.js - About 4 days to fix

        Function applyDirectivesToNode has 364 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,
                                           jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,
                                           previousCompileContext) {
              previousCompileContext = previousCompileContext || {};
        
        
        Severity: Major
        Found in src/ng/compile.js - About 1 day to fix

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

                function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
                  var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element,
                      attrs, scopeBindingInfo;
          
                  if (compileNode === linkNode) {
          Severity: Major
          Found in src/ng/compile.js - About 5 hrs to fix

            Function initializeDirectiveBindings has 134 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {
                  var removeWatchCollection = [];
                  var initialChanges = {};
                  var changes;
            
            
            Severity: Major
            Found in src/ng/compile.js - About 5 hrs to fix

              Function initializeBinding has 101 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    forEach(bindings, function initializeBinding(definition, scopeName) {
                      var attrName = definition.attrName,
                      optional = definition.optional,
                      mode = definition.mode, // @, =, <, or &
                      lastValue,
              Severity: Major
              Found in src/ng/compile.js - About 4 hrs to fix

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

                    function compileTemplateUrl(directives, $compileNode, tAttrs,
                        $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {
                      var linkQueue = [],
                          afterTemplateNodeLinkFn,
                          afterTemplateChildLinkFn,
                Severity: Major
                Found in src/ng/compile.js - About 3 hrs to fix

                  Function collectDirectives has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
                        var nodeType = node.nodeType,
                            attrsMap = attrs.$attr,
                            match,
                            nodeName,
                  Severity: Major
                  Found in src/ng/compile.js - About 3 hrs to fix

                    Function compileNodes has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,
                                                previousCompileContext) {
                          var linkFns = [],
                              // `nodeList` can be either an element's `.childNodes` (live NodeList)
                              // or a jqLite/jQuery collection or an array
                    Severity: Major
                    Found in src/ng/compile.js - About 2 hrs to fix

                      Function $set has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            $set: function(key, value, writeAttr, attrName) {
                              // TODO: decide whether or not to throw an error if "class"
                              // is set through this function since it may cause $updateClass to
                              // become unstable.
                      
                      
                      Severity: Minor
                      Found in src/ng/compile.js - About 2 hrs to fix

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

                            function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,
                                                previousCompileContext) {
                              if (!($compileNodes instanceof jqLite)) {
                                // jquery always rewraps, whereas we need to preserve the original selector so that we can
                                // modify it.
                        Severity: Minor
                        Found in src/ng/compile.js - About 1 hr to fix

                          Function replaceWith has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function replaceWith($rootElement, elementsToRemove, newNode) {
                                var firstElementToRemove = elementsToRemove[0],
                                    removeCount = elementsToRemove.length,
                                    parent = firstElementToRemove.parentNode,
                                    i, ii;
                          Severity: Minor
                          Found in src/ng/compile.js - About 1 hr to fix

                            Function registerNativePropertyContexts has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              (function registerNativePropertyContexts() {
                                function registerContext(ctx, values) {
                                  forEach(values, function(v) { PROP_CONTEXTS[v.toLowerCase()] = ctx; });
                                }
                            
                            
                            Severity: Minor
                            Found in src/ng/compile.js - About 1 hr to fix

                              Function addAttrInterpolateDirective has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function addAttrInterpolateDirective(node, directives, value, name, isNgAttr) {
                                    var nodeName = nodeName_(node);
                                    var trustedContext = getTrustedAttrContext(nodeName, name);
                                    var mustHaveExpression = !isNgAttr;
                                    var allOrNothing = ALL_OR_NOTHING_ATTRS[name] || isNgAttr;
                              Severity: Minor
                              Found in src/ng/compile.js - About 1 hr to fix

                                Function registerComponent has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  this.component = function registerComponent(name, options) {
                                    if (!isString(name)) {
                                      forEach(name, reverseParams(bind(this, registerComponent)));
                                      return this;
                                    }
                                Severity: Minor
                                Found in src/ng/compile.js - About 1 hr to fix

                                  Function publicLinkFn has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        return function publicLinkFn(scope, cloneConnectFn, options) {
                                          if (!$compileNodes) {
                                            throw $compileMinErr('multilink', 'This element has already been linked.');
                                          }
                                          assertArg(scope, 'scope');
                                  Severity: Minor
                                  Found in src/ng/compile.js - About 1 hr to fix

                                    Function compositeLinkFn has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {
                                            var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;
                                            var stableNodeList;
                                    
                                    
                                    
                                    Severity: Minor
                                    Found in src/ng/compile.js - About 1 hr to fix

                                      Function registerDirective has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        this.directive = function registerDirective(name, directiveFactory) {
                                          assertArg(name, 'name');
                                          assertNotHasOwnProperty(name, 'directive');
                                          if (isString(name)) {
                                            assertValidDirectiveName(name);
                                      Severity: Minor
                                      Found in src/ng/compile.js - About 1 hr to fix

                                        Function getControllers has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            function getControllers(directiveName, require, $element, elementControllers) {
                                              var value;
                                        
                                              if (isString(require)) {
                                                var match = require.match(REQUIRE_PREFIX_REGEXP);
                                        Severity: Minor
                                        Found in src/ng/compile.js - About 1 hr to fix

                                          Function addPropertyDirective has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              function addPropertyDirective(node, directives, attrName, propName) {
                                                if (EVENT_HANDLER_ATTR_REGEXP.test(propName)) {
                                                  throw $compileMinErr('nodomevents', 'Property bindings for HTML DOM event properties are disallowed');
                                                }
                                          
                                          
                                          Severity: Minor
                                          Found in src/ng/compile.js - About 1 hr to fix

                                            Function $get has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                function($injector,   $interpolate,   $exceptionHandler,   $templateRequest,   $parse,
                                                         $controller,   $rootScope,   $sce,   $animate) {
                                            Severity: Major
                                            Found in src/ng/compile.js - About 1 hr to fix

                                              Function applyDirectivesToNode has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                  function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,
                                                                                 jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,
                                                                                 previousCompileContext) {
                                              Severity: Major
                                              Found in src/ng/compile.js - About 1 hr to fix

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

                                                  function parseIsolateBindings(scope, directiveName, isController) {
                                                    var LOCAL_REGEXP = /^([@&]|[=<](\*?))(\??)\s*([\w$]*)$/;
                                                
                                                    var bindings = createMap();
                                                
                                                
                                                Severity: Minor
                                                Found in src/ng/compile.js - About 1 hr to fix

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

                                                          function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {
                                                            var transcludeControllers;
                                                            // No scope passed in:
                                                            if (!isScope(scope)) {
                                                              slotName = futureParentElement;
                                                  Severity: Minor
                                                  Found in src/ng/compile.js - About 1 hr to fix

                                                    Function compileTemplateUrl has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                        function compileTemplateUrl(directives, $compileNode, tAttrs,
                                                            $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {
                                                    Severity: Major
                                                    Found in src/ng/compile.js - About 1 hr to fix

                                                      Function tokenDifference has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                      function tokenDifference(str1, str2) {
                                                        var values = '',
                                                            tokens1 = str1.split(/\s+/),
                                                            tokens2 = str2.split(/\s+/);
                                                      
                                                      
                                                      Severity: Minor
                                                      Found in src/ng/compile.js - 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 setupControllers has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                          function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective) {
                                                      Severity: Major
                                                      Found in src/ng/compile.js - About 50 mins to fix

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

                                                            function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,
                                                                                  endAttrName) {
                                                        Severity: Major
                                                        Found in src/ng/compile.js - About 50 mins to fix

                                                          Function compileNodes has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                              function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,
                                                                                      previousCompileContext) {
                                                          Severity: Minor
                                                          Found in src/ng/compile.js - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                            if (slotName) {
                                                                              filledSlots[slotName] = true;
                                                                              slots[slotName] = slots[slotName] || window.document.createDocumentFragment();
                                                                              slots[slotName].appendChild(node);
                                                                            } else {
                                                            Severity: Major
                                                            Found in src/ng/compile.js - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                            if (isObject(bindings.isolateScope)) {
                                                                              directive.$$isolateBindings = bindings.isolateScope;
                                                                            }
                                                              Severity: Major
                                                              Found in src/ng/compile.js - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                if (!filled) {
                                                                                  throw $compileMinErr('reqslot', 'Required transclusion slot `{0}` was not filled.', slotName);
                                                                                }
                                                                Severity: Major
                                                                Found in src/ng/compile.js - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                if (j2 < jj) {
                                                                                  $rootElement[j] = $rootElement[j2];
                                                                                } else {
                                                                                  delete $rootElement[j];
                                                                                }
                                                                  Severity: Major
                                                                  Found in src/ng/compile.js - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                    if (getBooleanAttrName(node, nName)) {
                                                                                      attrs[nName] = true; // presence means true
                                                                                    }
                                                                    Severity: Major
                                                                    Found in src/ng/compile.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                    for (var slotName in slots) {
                                                                                      if (slots[slotName]) {
                                                                                        // Only define a transclusion function if the slot was filled
                                                                                        var slotCompileNodes = jqLite(slots[slotName].childNodes);
                                                                                        slots[slotName] = compilationGenerator(mightHaveMultipleTransclusionError, slotCompileNodes, transcludeFn);
                                                                      Severity: Major
                                                                      Found in src/ng/compile.js - About 45 mins to fix

                                                                        Function compilationGenerator has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                        Open

                                                                            function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {
                                                                        Severity: Minor
                                                                        Found in src/ng/compile.js - About 45 mins to fix

                                                                          Function invokeLinkFn has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                          Open

                                                                              function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {
                                                                          Severity: Minor
                                                                          Found in src/ng/compile.js - About 45 mins to fix

                                                                            Consider simplifying this complex logical expression.
                                                                            Open

                                                                                  } else if (
                                                                                      // Formaction
                                                                                      (nodeName === 'form' && attrNormalizedName === 'action') ||
                                                                                      // If relative URLs can go where they are not expected to, then
                                                                                      // all sorts of trust issues can arise.
                                                                            Severity: Major
                                                                            Found in src/ng/compile.js - About 40 mins to fix

                                                                              Consider simplifying this complex logical expression.
                                                                              Open

                                                                                      if (!didScanForMultipleTransclusion && ((directive.replace && (directive.templateUrl || directive.template))
                                                                                          || (directive.transclude && !directive.$$tlb))) {
                                                                                              var candidateDirective;
                                                                              
                                                                                              for (var scanningIndex = i + 1; (candidateDirective = directives[scanningIndex++]);) {
                                                                              Severity: Major
                                                                              Found in src/ng/compile.js - About 40 mins to fix

                                                                                Function collectDirectives has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                Open

                                                                                    function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
                                                                                Severity: Minor
                                                                                Found in src/ng/compile.js - About 35 mins to fix

                                                                                  Function collectCommentDirectives has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                  Open

                                                                                      function collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
                                                                                  Severity: Minor
                                                                                  Found in src/ng/compile.js - About 35 mins to fix

                                                                                    Function nodeLinkFn has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                    Open

                                                                                          function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
                                                                                    Severity: Minor
                                                                                    Found in src/ng/compile.js - About 35 mins to fix

                                                                                      Function initializeDirectiveBindings has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                      Open

                                                                                          function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {
                                                                                      Severity: Minor
                                                                                      Found in src/ng/compile.js - About 35 mins to fix

                                                                                        Function directiveLinkingFn has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                        Open

                                                                                          /* nodesetLinkingFn */ nodesetLinkingFn,
                                                                                          /* angular.Scope */ scope,
                                                                                          /* Node */ node,
                                                                                          /* Element */ rootElement,
                                                                                          /* function(Function) */ boundTranscludeFn
                                                                                        Severity: Minor
                                                                                        Found in src/ng/compile.js - About 35 mins to fix

                                                                                          Function addAttrInterpolateDirective has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                          Open

                                                                                              function addAttrInterpolateDirective(node, directives, value, name, isNgAttr) {
                                                                                          Severity: Minor
                                                                                          Found in src/ng/compile.js - About 35 mins to fix

                                                                                            Function boundTranscludeFn has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                            Open

                                                                                                  function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
                                                                                            Severity: Minor
                                                                                            Found in src/ng/compile.js - About 35 mins to fix

                                                                                              Function compile has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                              Open

                                                                                                  function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,
                                                                                                                      previousCompileContext) {
                                                                                              Severity: Minor
                                                                                              Found in src/ng/compile.js - About 35 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                        return $sce.URL;
                                                                                                Severity: Major
                                                                                                Found in src/ng/compile.js - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                          if (nodeName === 'a') return $sce.URL;
                                                                                                  Severity: Major
                                                                                                  Found in src/ng/compile.js - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                            return $sce.RESOURCE_URL;
                                                                                                    Severity: Major
                                                                                                    Found in src/ng/compile.js - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                              return $sce.RESOURCE_URL;
                                                                                                      Severity: Major
                                                                                                      Found in src/ng/compile.js - About 30 mins to fix

                                                                                                        Function removeComments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                        function removeComments(jqNodes) {
                                                                                                          jqNodes = jqLite(jqNodes);
                                                                                                          var i = jqNodes.length;
                                                                                                        
                                                                                                          if (i <= 1) {
                                                                                                        Severity: Minor
                                                                                                        Found in src/ng/compile.js - About 25 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

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

                                                                                                                if (post) {
                                                                                                                  if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);
                                                                                                                  post.require = directive.require;
                                                                                                                  post.directiveName = directiveName;
                                                                                                                  if (newIsolateScopeDirective === directive || directive.$$isolateScope) {
                                                                                                        Severity: Major
                                                                                                        Found in src/ng/compile.js and 1 other location - About 3 hrs to fix
                                                                                                        src/ng/compile.js on lines 3230..3238

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

                                                                                                        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 (pre) {
                                                                                                                  if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);
                                                                                                                  pre.require = directive.require;
                                                                                                                  pre.directiveName = directiveName;
                                                                                                                  if (newIsolateScopeDirective === directive || directive.$$isolateScope) {
                                                                                                        Severity: Major
                                                                                                        Found in src/ng/compile.js and 1 other location - About 3 hrs to fix
                                                                                                        src/ng/compile.js on lines 3239..3247

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

                                                                                                        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

                                                                                                                for (i = postLinkFns.length - 1; i >= 0; i--) {
                                                                                                                  linkFn = postLinkFns[i];
                                                                                                                  invokeLinkFn(linkFn,
                                                                                                                      linkFn.isolateScope ? isolateScope : scope,
                                                                                                                      $element,
                                                                                                        Severity: Major
                                                                                                        Found in src/ng/compile.js and 1 other location - About 1 hr to fix
                                                                                                        src/ng/compile.js on lines 3348..3357

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

                                                                                                        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

                                                                                                                for (i = 0, ii = preLinkFns.length; i < ii; i++) {
                                                                                                                  linkFn = preLinkFns[i];
                                                                                                                  invokeLinkFn(linkFn,
                                                                                                                      linkFn.isolateScope ? isolateScope : scope,
                                                                                                                      $element,
                                                                                                        Severity: Major
                                                                                                        Found in src/ng/compile.js and 1 other location - About 1 hr to fix
                                                                                                        src/ng/compile.js on lines 3371..3380

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

                                                                                                        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

                                                                                                          this.aHrefSanitizationTrustedUrlList = function(regexp) {
                                                                                                            if (isDefined(regexp)) {
                                                                                                              $$sanitizeUriProvider.aHrefSanitizationTrustedUrlList(regexp);
                                                                                                              return this;
                                                                                                            } else {
                                                                                                        Severity: Major
                                                                                                        Found in src/ng/compile.js and 1 other location - About 1 hr to fix
                                                                                                        src/ng/compile.js on lines 1770..1777

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

                                                                                                        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

                                                                                                          this.imgSrcSanitizationTrustedUrlList = function(regexp) {
                                                                                                            if (isDefined(regexp)) {
                                                                                                              $$sanitizeUriProvider.imgSrcSanitizationTrustedUrlList(regexp);
                                                                                                              return this;
                                                                                                            } else {
                                                                                                        Severity: Major
                                                                                                        Found in src/ng/compile.js and 1 other location - About 1 hr to fix
                                                                                                        src/ng/compile.js on lines 1719..1726

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

                                                                                                        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

                                                                                                          Object.defineProperty(this, 'aHrefSanitizationWhitelist', {
                                                                                                            get: function() {
                                                                                                              return this.aHrefSanitizationTrustedUrlList;
                                                                                                            },
                                                                                                            set: function(value) {
                                                                                                        Severity: Major
                                                                                                        Found in src/ng/compile.js and 2 other locations - About 1 hr to fix
                                                                                                        src/ng/compile.js on lines 1791..1798
                                                                                                        src/ng/sce.js on lines 230..237

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

                                                                                                        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

                                                                                                          Object.defineProperty(this, 'imgSrcSanitizationWhitelist', {
                                                                                                            get: function() {
                                                                                                              return this.imgSrcSanitizationTrustedUrlList;
                                                                                                            },
                                                                                                            set: function(value) {
                                                                                                        Severity: Major
                                                                                                        Found in src/ng/compile.js and 2 other locations - About 1 hr to fix
                                                                                                        src/ng/compile.js on lines 1740..1747
                                                                                                        src/ng/sce.js on lines 230..237

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

                                                                                                        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

                                                                                                              $addClass: function(classVal) {
                                                                                                                if (classVal && classVal.length > 0) {
                                                                                                                  $animate.addClass(this.$$element, classVal);
                                                                                                                }
                                                                                                              },
                                                                                                        Severity: Minor
                                                                                                        Found in src/ng/compile.js and 1 other location - About 40 mins to fix
                                                                                                        src/ng/compile.js on lines 2195..2199

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

                                                                                                        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

                                                                                                              $removeClass: function(classVal) {
                                                                                                                if (classVal && classVal.length > 0) {
                                                                                                                  $animate.removeClass(this.$$element, classVal);
                                                                                                                }
                                                                                                              },
                                                                                                        Severity: Minor
                                                                                                        Found in src/ng/compile.js and 1 other location - About 40 mins to fix
                                                                                                        src/ng/compile.js on lines 2178..2182

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

                                                                                                        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 (!hasOwnProperty.call(attrs, attrName)) {
                                                                                                                      if (optional) break;
                                                                                                                      strictBindingsCheck(attrName, directive.name);
                                                                                                                      attrs[attrName] = undefined;
                                                                                                                    }
                                                                                                        Severity: Minor
                                                                                                        Found in src/ng/compile.js and 1 other location - About 35 mins to fix
                                                                                                        src/ng/compile.js on lines 4157..4161

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

                                                                                                        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 (!hasOwnProperty.call(attrs, attrName)) {
                                                                                                                      if (optional) break;
                                                                                                                      strictBindingsCheck(attrName, directive.name);
                                                                                                                      attrs[attrName] = undefined;
                                                                                                                    }
                                                                                                        Severity: Minor
                                                                                                        Found in src/ng/compile.js and 1 other location - About 35 mins to fix
                                                                                                        src/ng/compile.js on lines 4112..4116

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

                                                                                                        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

                                                                                                        There are no issues that match your filters.

                                                                                                        Category
                                                                                                        Status