Showing 10 of 23 total issues
Function TableSort
has a Cognitive Complexity of 182 (exceeds 5 allowed). Consider refactoring. Open
function TableSort() {
var table = new Object; // The table to be sorted
var columnNames = new Array;
var tableRows = new Array;
- 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 TableSort
has 184 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TableSort() {
var table = new Object; // The table to be sorted
var columnNames = new Array;
var tableRows = new Array;
Function isort
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isort(desc, start, step) {
for(var j=start+step; j<N; j+=step) {
if (desc==true) {
Function read_nose
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def read_nose(in_file):
""" Parse nose-style test reports into a `dict`
Args:
in_file (:obj:`str`): path to nose-style test report
- 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 sortOnColumn
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sortOnColumn(column) {
columnIdx = column.cellIndex;
columnTypeAbbr = column.abbr; // In case there is some special comparison needed.
Function write_unitth
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def write_unitth(suites, out_dir):
""" Write UnitTH-style test reports
Args:
suites (:obj:`dict`): dictionary of test suites
- 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
Avoid deeply nested control flow statements. Open
if (sIdx1<0) {
sStripped = second;
} else {
var sIdx2 = second.lastIndexOf('<');
sStripped = second.substring((sIdx1+1),(sIdx2-1));
Avoid deeply nested control flow statements. Open
if (fStripped>sStripped) {
exchange(i, (i-step));
}
Avoid deeply nested control flow statements. Open
} else if ('number'==columnTypeAbbr) {
var fa = parseFloat(first);
var sa = parseFloat(second);
if (isNaN(fa) ) {
fa = 0;
Avoid deeply nested control flow statements. Open
if (fIdx1<0) {
fStripped = first;
} else {
var fIdx2 = first.lastIndexOf('<');
fStripped = first.substring((fIdx1+1),(fIdx2-1));