angular/angular.js

View on GitHub
src/ng/directive/ngTransclude.js

Summary

Maintainability
C
1 day
Test Coverage

Function ngTranscludeDirective has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

var ngTranscludeDirective = ['$compile', function($compile) {
  return {
    restrict: 'EAC',
    compile: function ngTranscludeCompile(tElement) {

Severity: Minor
Found in src/ng/directive/ngTransclude.js - About 3 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

Function ngTranscludeDirective has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var ngTranscludeDirective = ['$compile', function($compile) {
  return {
    restrict: 'EAC',
    compile: function ngTranscludeCompile(tElement) {

Severity: Minor
Found in src/ng/directive/ngTransclude.js - About 1 hr to fix

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

        compile: function ngTranscludeCompile(tElement) {
    
          // Remove and cache any original content to act as a fallback
          var fallbackLinkFn = $compile(tElement.contents());
          tElement.empty();
    Severity: Minor
    Found in src/ng/directive/ngTransclude.js - About 1 hr to fix

      Function ngTranscludePostLink has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            return function ngTranscludePostLink($scope, $element, $attrs, controller, $transclude) {
      
              if (!$transclude) {
                throw ngTranscludeMinErr('orphan',
                'Illegal use of ngTransclude directive in the template! ' +
      Severity: Minor
      Found in src/ng/directive/ngTransclude.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status