etnbrd/flx-compiler

View on GitHub
test-set/express-endpoint-master/lib/rules.js

Summary

Maintainability
B
4 hrs
Test Coverage

Function boolean has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  , 'boolean': function(name) {
      return function(vals, cb) {
        if (vals.length > 1) {
          cb(new Error("The parameter only accepts one value"))
        } else {
Severity: Minor
Found in test-set/express-endpoint-master/lib/rules.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 timestamp has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  , timestamp: function(name) {
      return function(vals, cb) {
        try {
          var mapped = vals.map(function(val) {
            if (val.match(/^-?[0-9]+(\.[0-9]+)?$/)) {
Severity: Minor
Found in test-set/express-endpoint-master/lib/rules.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 callback has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  , callback: function(name) {
      return function(vals, cb) {
        if (vals.length > 1) {
          cb(new Error("The parameter can only be specified once"))
        } else {
Severity: Minor
Found in test-set/express-endpoint-master/lib/rules.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 url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  , url: function(name) {
      return function(vals, cb) {
        try {
          var mapped = vals.map(function(val) {
            var purl = urlparse(val)
Severity: Minor
Found in test-set/express-endpoint-master/lib/rules.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

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

  { number: function(name) {
      return function(vals, cb) {
        try {
          var mapped = vals.map(function(val) {
            if (val.match(/^-?[0-9]+(\.[0-9]+)?$/)) {
Severity: Minor
Found in test-set/express-endpoint-master/lib/rules.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