Showing 6 of 10 total issues
Function DrawUtil
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
function DrawUtil(numOfLines) {
var width = shell.getWidth() * 0.75 | 0;
var maxHeight = shell.getHeight() - 1;
this.numberOfLines = Math.max(4, Math.min(numOfLines, maxHeight));
- 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 DrawUtil
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DrawUtil(numOfLines) {
var width = shell.getWidth() * 0.75 | 0;
var maxHeight = shell.getHeight() - 1;
this.numberOfLines = Math.max(4, Math.min(numOfLines, maxHeight));
Function ShellUtility
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var ShellUtility = function() {
var self = this;
var winSize = useStdout ? stdout.getWindowSize(1) : [75, 4];
this.getWidth = function() {
Function onSpecComplete
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NyanCat.prototype.onSpecComplete = function(browser, result) {
// don't pollute original object
this.stats = Object.create(browser.lastResult);
// sum up tests stats
Function printBrowserErrors
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function printBrowserErrors(rainbowify, browserErrors) {
if (rainbowify && browserErrors) {
var hashes = '##########'.split('');
var rainbowifyEach = function(val) {
write(rainbowify(val));
Function printBrowserErrors
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function printBrowserErrors(rainbowify, browserErrors) {
if (rainbowify && browserErrors) {
var hashes = '##########'.split('');
var rainbowifyEach = function(val) {
write(rainbowify(val));
- 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"