Showing 6 of 8 total issues
Function processControlCharacter
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var processControlCharacter = function (token, remainder) {
//console.log("Looking at cc token: ", token, remainder);
var basicHandler = function(response) {
return function (token, remainder) {
return basicResponse(response, remainder);
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
"use strict";
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
Function createHexParser
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var createHexParser = function (length) {
return function (token, remainder) {
var digitsToParse = _.slice(remainder, 0, length);
if(digitsToParse.length !== length) {
throw new Error("Not enough characters in hex string. Expected " + length + ", got " + digitsToParse.length);
- 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 charClassParser
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var charClassParser = function (token, remainder, validString) {
//console.log("parse class: ", token, remainder, validString);
if(_.isUndefined(validString)) {
validString = "";
}
- 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 processGroup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var processGroup = function (token, remainder) {
var capture = true;
if(remainder[0] === "?" && remainder[1] === ":") {
remainder = _.slice(remainder,2);
capture = false;
- 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 parseOctal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var parseOctal = function (token, remainder) {
if(!(isOctalDigit(remainder[0]))) {
if(token === "0") {
return basicResponse("\0", remainder);
} else {
- 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"