jasonhillier/challenge

View on GitHub

Showing 7 of 9 total issues

Function ChallengeInitializer has 258 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ChallengeInitializer(pOptions)
{
    var libSuperTest = null;
    var _BaseJsonPath = argv.jsonPath || path.dirname(module.parent.filename) + '/';
    //Configure test runner, include a Rest client
Severity: Major
Found in source/Challenge.js - About 1 day to fix

    Function ChallengeInitializer has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
    Open

    function ChallengeInitializer(pOptions)
    {
        var libSuperTest = null;
        var _BaseJsonPath = argv.jsonPath || path.dirname(module.parent.filename) + '/';
        //Configure test runner, include a Rest client
    Severity: Minor
    Found in source/Challenge.js - About 1 day 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 cases has 210 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            cases: function(pOptions)
            {
                var tmpAllCaseData = pOptions;
    
                if (pOptions.constructor !== Array)
    Severity: Major
    Found in source/Challenge.js - About 1 day to fix

      Function testApi has 116 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                      testApi: function(pName, pOptions, fValidation)
                      {
                          return testDefinition.test(pName, function(pCase, fDone)
                              {
                                  var tmpOptions = (typeof(pOptions) === 'function') ? pOptions(pCase) : pOptions;
      Severity: Major
      Found in source/Challenge.js - About 4 hrs to fix

        File Challenge.js has 272 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
        * The Challenge Module
        *
        * @author Jason Hillier <jason@paviasystems.com>
        * @class Challenge
        Severity: Minor
        Found in source/Challenge.js - About 2 hrs to fix

          Function test has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                          test: function(pName, fTest)
                          {
                              for (var i=0; i<tmpAllCaseData.length; i++)
                              {
                                  //keep test case data contextualized with the test function definition
          Severity: Minor
          Found in source/Challenge.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (tmpAllCaseData[x])
                                        {
                                            tmpAllCaseData[x][join.name] = tmpJoinCases[x];
                                        }
                                        else
            Severity: Major
            Found in source/Challenge.js - About 45 mins to fix
              Severity
              Category
              Status
              Source
              Language