socketstream/socketstream

View on GitHub
docs/js/angular-bootstrap.js

Summary

Maintainability
F
3 days
Test Coverage

Function tabbable has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

directive.tabbable = function() {
  return {
    restrict: 'C',
    compile: function(element) {
      var navTabs = angular.element('<ul class="nav nav-tabs"></ul>'),
Severity: Minor
Found in docs/js/angular-bootstrap.js - About 5 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

File angular-bootstrap.js has 338 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var directive = {};

directive.dropdownToggle =
Severity: Minor
Found in docs/js/angular-bootstrap.js - About 4 hrs to fix

    Function popoverElement has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var popoverElement = function() {
      var object = {
        init : function() {
          this.element = angular.element(
            '<div class="popover popover-incode top">' +
    Severity: Major
    Found in docs/js/angular-bootstrap.js - About 3 hrs to fix

      Function tabbable has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      directive.tabbable = function() {
        return {
          restrict: 'C',
          compile: function(element) {
            var navTabs = angular.element('<ul class="nav nav-tabs"></ul>'),
      Severity: Major
      Found in docs/js/angular-bootstrap.js - About 3 hrs to fix

        Function controller has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            controller: ['$scope', '$element', function($scope, $element) {
              var navTabs = $element.contents().eq(0),
                  ngModel = $element.controller('ngModel') || {},
                  tabs = [],
                  selectedTab;
        Severity: Major
        Found in docs/js/angular-bootstrap.js - About 2 hrs to fix

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

          directive.syntax = function() {
            return {
              restrict: 'A',
              link: function(scope, element, attrs) {
                function makeLink(type, text, link, icon) {
          Severity: Minor
          Found in docs/js/angular-bootstrap.js - About 1 hr to fix

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

                  this.addPane = function(element, attr) {
                    var li = angular.element('<li><a href></a></li>'),
                        a = li.find('a'),
                        tab = {
                          paneElement: element,
            Severity: Minor
            Found in docs/js/angular-bootstrap.js - About 1 hr to fix

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

                  link: function(scope, element, attrs) {
                    function makeLink(type, text, link, icon) {
                      return '<a href="' + link + '" class="btn syntax-' + type + '" target="_blank" rel="nofollow">' + 
                              '<span class="' + icon + '"></span> ' + text +
                             '</a>';
              Severity: Minor
              Found in docs/js/angular-bootstrap.js - About 1 hr to fix

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

                directive.foldout = ['$http', '$animate','$window', function($http, $animate, $window) {
                  return {
                    restrict: 'A',
                    priority : 500,
                    link: function(scope, element, attrs) {
                Severity: Minor
                Found in docs/js/angular-bootstrap.js - About 1 hr to fix

                  Function dropdownToggle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function ($document,   $location,   $window) {
                      var openElement = null, close;
                      return {
                        restrict: 'C',
                        link: function(scope, element, attrs) {
                  Severity: Minor
                  Found in docs/js/angular-bootstrap.js - About 1 hr to fix

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

                        link: function(scope, element, attrs) {
                          var container, loading, url = attrs.url;
                          if(/\/build\//.test($window.location.href)) {
                            url = '/build/docs' + url;
                          }
                    Severity: Minor
                    Found in docs/js/angular-bootstrap.js - About 1 hr to fix

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

                            link: function(scope, element, attrs) {
                              scope.$watch(function dropdownTogglePathWatch(){return $location.path();}, function dropdownTogglePathWatchAction() {
                                close && close();
                              });
                      
                      
                      Severity: Minor
                      Found in docs/js/angular-bootstrap.js - About 1 hr to fix

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

                            init : function() {
                              this.element = angular.element(
                                '<div class="popover popover-incode top">' +
                                  '<div class="arrow"></div>' +
                                  '<div class="popover-inner">' +
                        Severity: Minor
                        Found in docs/js/angular-bootstrap.js - About 1 hr to fix

                          Function dropdownToggle has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                            function ($document,   $location,   $window) {
                              var openElement = null, close;
                              return {
                                restrict: 'C',
                                link: function(scope, element, attrs) {
                          Severity: Minor
                          Found in docs/js/angular-bootstrap.js - About 45 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 popoverElement has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          var popoverElement = function() {
                            var object = {
                              init : function() {
                                this.element = angular.element(
                                  '<div class="popover popover-incode top">' +
                          Severity: Minor
                          Found in docs/js/angular-bootstrap.js - About 45 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

                          There are no issues that match your filters.

                          Category
                          Status