bbc/flashheart

View on GitHub
docconfig/template/publish.js

Summary

Maintainability
D
2 days
Test Coverage

Function publish has 200 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.publish = function(taffyData, opts, tutorials) {
    var docdash = env && env.conf && env.conf.docdash || {};
    data = taffyData;

    var conf = env.conf.templates || {};
Severity: Major
Found in docconfig/template/publish.js - About 1 day to fix

    File publish.js has 487 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*global env: true */
    'use strict';
    
    var doop = require('jsdoc/util/doop');
    var fs = require('jsdoc/fs');
    Severity: Minor
    Found in docconfig/template/publish.js - About 7 hrs to fix

      Function publish has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.publish = function(taffyData, opts, tutorials) {
          var docdash = env && env.conf && env.conf.docdash || {};
          data = taffyData;
      
          var conf = env.conf.templates || {};
      Severity: Minor
      Found in docconfig/template/publish.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 buildMemberNav has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) {
          var nav = '';
      
          if (items && items.length) {
              var itemsNav = '';
      Severity: Minor
      Found in docconfig/template/publish.js - About 1 hr to fix

        Function buildNav has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function buildNav(members) {
            var nav = '<h2><a href="index.html">Home</a></h2>';
            var seen = {};
            var seenTutorials = {};
        
        
        Severity: Minor
        Found in docconfig/template/publish.js - About 1 hr to fix

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

          function needsSignature(doclet) {
              var needsSig = false;
          
              // function and class definitions always get a signature
              if (doclet.kind === 'function' || doclet.kind === 'class') {
          Severity: Minor
          Found in docconfig/template/publish.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 generate has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function generate(type, title, docs, filename, resolveLinks) {
          Severity: Minor
          Found in docconfig/template/publish.js - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status