MitocGroup/deep-framework

View on GitHub
src/deep-resource/lib/Resource/SuperagentResponse.js

Summary

Maintainability
C
7 hrs
Test Coverage

Function _parseLambda has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  _parseLambda() {
    this._parseExternal();

    // check if any Lambda response available
    if (this._data) {
Severity: Minor
Found in src/deep-resource/lib/Resource/SuperagentResponse.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 _parseExternal has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  _parseExternal() {
    let data = this._rawData;
    let error = this._rawError;

    if (error) {
Severity: Minor
Found in src/deep-resource/lib/Resource/SuperagentResponse.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 _parseLambda has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _parseLambda() {
    this._parseExternal();

    // check if any Lambda response available
    if (this._data) {
Severity: Minor
Found in src/deep-resource/lib/Resource/SuperagentResponse.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

          if (this._error && typeof this._error === 'object' 
            && this._error.crossDomain 
            && typeof this._error.crossDomain.status === 'undefined') {
              
            this._statusCode = 403;
    Severity: Major
    Found in src/deep-resource/lib/Resource/SuperagentResponse.js - About 40 mins to fix

      There are no issues that match your filters.

      Category
      Status