lib/modelToModel/smwLayer.js

Summary

Maintainability
C
1 day
Test Coverage

Function analyzeType has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

exports.analyzeType = function(obj) {
    'use strict';

    // Analyze the attribute type.
    var inspect = obj.items || obj;
Severity: Minor
Found in lib/modelToModel/smwLayer.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 analyzeType has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.analyzeType = function(obj) {
    'use strict';

    // Analyze the attribute type.
    var inspect = obj.items || obj;
Severity: Minor
Found in lib/modelToModel/smwLayer.js - About 1 hr to fix

    Function exec has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    exports.exec = function(settings, registry) {
    
        exports.settings = settings;
        exports.registry = registry;
    
    
    Severity: Minor
    Found in lib/modelToModel/smwLayer.js - About 35 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

    Avoid too many return statements within this function.
    Open

                return 'Text';
    Severity: Major
    Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return 'Email';
      Severity: Major
      Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return 'Code';
        Severity: Major
        Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return 'URL';
          Severity: Major
          Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return 'Geographic coordinate';
            Severity: Major
            Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return 'Date';
              Severity: Major
              Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return 'Text';
                Severity: Major
                Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return 'Record';
                  Severity: Major
                  Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return 'Quantity';
                    Severity: Major
                    Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return 'Temperature';
                      Severity: Major
                      Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return 'Telephone number';
                        Severity: Major
                        Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return 'Page';
                          Severity: Major
                          Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                            There are no issues that match your filters.

                            Category
                            Status