socketstream/socketstream

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

Summary

Maintainability
D
1 day
Test Coverage

Function ngEmbedApp has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                function($templateCache,   $browser,  docsRootScope, $location,   $sniffer,   $animate,   $exceptionHandler) {
  return {
    terminal: true,
    link: function(scope, element, attrs) {
      var modules = ['ngAnimate'],
Severity: Major
Found in docs/js/angular-bootstrap-prettify.js - About 2 hrs to fix

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

    'use strict';
    
    var directive = {};
    var service = { value: {} };
    
    
    Severity: Minor
    Found in docs/js/angular-bootstrap-prettify.js - About 2 hrs to fix

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

          link: function(scope, element, attrs) {
            var modules = ['ngAnimate'],
                embedRootScope,
                deregisterEmbedRootScope;
      
      
      Severity: Major
      Found in docs/js/angular-bootstrap-prettify.js - About 2 hrs to fix

        Function reindentCode has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

        service.reindentCode = function() {
          return function (text, spaces) {
            if (!text) return text;
            var lines = text.split(/\r?\n/);
            var prefix = '      '.substr(0, spaces || 0);
        Severity: Minor
        Found in docs/js/angular-bootstrap-prettify.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function jsFiddle has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        directive.jsFiddle = function(getEmbeddedTemplate, escape, script) {
          return {
            terminal: true,
            link: function(scope, element, attr) {
              var name = '',
        Severity: Minor
        Found in docs/js/angular-bootstrap-prettify.js - About 1 hr to fix

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

              link: function(scope, element, attr) {
                var name = '',
                  stylesheet = '<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">\n',
                  fields = {
                    html: '',
          Severity: Minor
          Found in docs/js/angular-bootstrap-prettify.js - About 1 hr to fix

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

                            function($templateCache,   $browser,  docsRootScope, $location,   $sniffer,   $animate,   $exceptionHandler) {
            Severity: Major
            Found in docs/js/angular-bootstrap-prettify.js - About 50 mins to fix

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

              service.templateMerge = ['reindentCode', function(indentCode) {
                return function(template, properties) {
                  return template.replace(/\{\{(\w+)(?:\:(\d+))?\}\}/g, function(_, key, indent) {
                    var value = properties[key];
              
              
              Severity: Minor
              Found in docs/js/angular-bootstrap-prettify.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

              There are no issues that match your filters.

              Category
              Status