oss-specs/specs

View on GitHub
views/helpers/index.js

Summary

Maintainability
B
6 hrs
Test Coverage

Function checkResultsFromList has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

function checkResultsFromList(array, scenario) {
  if (array && array.length > 0) {
    var passes ='';
    var scenarioName= scenario.name;
    if(scenario.type === 'ScenarioOutline' ) {
Severity: Minor
Found in views/helpers/index.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 compareJobsAndFeatures has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function compareJobsAndFeatures(array, scenarioName,directFeature) {
  if (array && array.length > 0) {
    var passes ='';
    for( var i = 0; i < array.length ; i++) {
      //If we check direct equals then we miss out some in scenario outline that end in digits, so needs changing
Severity: Minor
Found in views/helpers/index.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

Avoid deeply nested control flow statements.
Open

          for (var iBody = 0; iBody < scenario.examples[j].tableBody.length; iBody++) {
            for (var iHeader = 0; iHeader < scenario.examples[j].tableHeader.cells.length; iHeader++) {
              var re = new RegExp('<' + scenario.examples[j].tableHeader.cells[iHeader].value + '>', 'g');
              updatedName = updatedName.replace(re, scenario.examples[j].tableBody[iBody].cells[iHeader].value);
            }
Severity: Major
Found in views/helpers/index.js - About 45 mins to fix

There are no issues that match your filters.

Category
Status