bbc/flashheart

View on GitHub

Showing 28 of 73 total issues

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 processExpressionObject has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function processExpressionObject( val, key ) {
    var operator;
    if ( sys.isObject( val ) ) {
        var opKeys = Object.keys( val );
        var op = opKeys[ 0 ];
Severity: Minor
Found in docconfig/template/fixtures/documents/probe.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 configureClient has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function configureClient(params: ClientParams): httpTransport.HttpTransportClient {
  const transport = configureRequest(params);
  const builder = httpTransport
    .createBuilder(transport)
    .retries(getRetries(params))
Severity: Minor
Found in src/httpTransport/configuration.ts - 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 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

    Avoid too many return statements within this function.
    Open

                        return parent[lastPart].push( newValue );
    Severity: Major
    Found in docconfig/template/fixtures/documents/probe.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return parent[lastPart];
      Severity: Major
      Found in docconfig/template/fixtures/documents/probe.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                                return parent[lastPart].shift();
        Severity: Major
        Found in docconfig/template/fixtures/documents/probe.js - About 30 mins to fix

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

              $elemMatch : function ( qu, value ) {
                  var expression, test, _i, _len;
          
                  if ( sys.isArray( value ) ) {
                      var _ref = qu.operands;
          Severity: Minor
          Found in docconfig/template/fixtures/documents/probe.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

          Severity
          Category
          Status
          Source
          Language