Showing 7 of 9 total issues
Function ChallengeInitializer
has 258 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ChallengeInitializer(pOptions)
{
var libSuperTest = null;
var _BaseJsonPath = argv.jsonPath || path.dirname(module.parent.filename) + '/';
//Configure test runner, include a Rest client
Function ChallengeInitializer
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
Open
function ChallengeInitializer(pOptions)
{
var libSuperTest = null;
var _BaseJsonPath = argv.jsonPath || path.dirname(module.parent.filename) + '/';
//Configure test runner, include a Rest client
- Read upRead up
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 cases
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
cases: function(pOptions)
{
var tmpAllCaseData = pOptions;
if (pOptions.constructor !== Array)
Function testApi
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
testApi: function(pName, pOptions, fValidation)
{
return testDefinition.test(pName, function(pCase, fDone)
{
var tmpOptions = (typeof(pOptions) === 'function') ? pOptions(pCase) : pOptions;
File Challenge.js
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* The Challenge Module
*
* @author Jason Hillier <jason@paviasystems.com>
* @class Challenge
Function test
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
test: function(pName, fTest)
{
for (var i=0; i<tmpAllCaseData.length; i++)
{
//keep test case data contextualized with the test function definition
Avoid deeply nested control flow statements. Open
Open
if (tmpAllCaseData[x])
{
tmpAllCaseData[x][join.name] = tmpJoinCases[x];
}
else