Showing 28 of 52 total issues
Function isApproxEqual
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
function isApproxEqual(x, y, opts) {
opts = opts || {};
var fnEqual = opts.fnEqual !== false;
var depth = opts.depth || 5; // totally arbitrary
- 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 isEqual
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function isEqual(a, b) {
var i;
if (isNaN(a) && isNaN(b)) {
return true;
- 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
File jsverify.js
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* @flow weak */
/**
# JSVerify
<img src="https://raw.githubusercontent.com/jsverify/jsverify/master/jsverify-300.png" align="right" height="100" />
Function forall
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function forall() {
var args = Array.prototype.slice.call(arguments);
var gens = args.slice(0, -1);
var property = args[args.length - 1];
var env;
Function isApproxEqual
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isApproxEqual(x, y, opts) {
opts = opts || {};
var fnEqual = opts.fnEqual !== false;
var depth = opts.depth || 5; // totally arbitrary
Function check
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function check(property, opts) {
opts = opts || {};
opts.size = opts.size || 50;
opts.tests = opts.tests || 100;
opts.quiet = opts.quiet || false;
Function loop
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loop(a, b, n) {
if (isNaN(a) && isNaN(b)) {
return true;
}
Function suchthat
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function suchthat(arb, userenv, predicate) {
var env;
if (arguments.length === 2) {
predicate = userenv;
env = environment;
- 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 isEqual
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isEqual(a, b) {
var i;
if (isNaN(a) && isNaN(b)) {
return true;
Function suchthat
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function suchthat(arb, userenv, predicate) {
var env;
if (arguments.length === 2) {
predicate = userenv;
env = environment;
Function redundancyProp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function redundancyProp(input, output) {
var len = output.length;
for (var i = 0; i < len; i++) {
for (var j = 0; j < len; j++) {
if (i === j) {
- 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 redundancyProp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function redundancyProp(input, output) {
var len = output.length;
for (var i = 0; i < len; i++) {
for (var j = 0; j < len; j++) {
if (i === j) {
- 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 shrinkResult
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function shrinkResult(arbs, x, test, size, shrinksN, exc, transform) {
Function integer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var integer = numeric(function integer(maxsize) {
return {
generator: generator.bless(function (size) {
size = maxsize === undefined ? size : maxsize;
return random(-size, size);
- 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 throws
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function throws(block, error, message) {
assert(error === undefined || typeof error === "function", "throws: error parameter must be a constructor");
assert(message === undefined || typeof message === "string", "throws: message parameter must be a string");
try {
- 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 formatFailedCase
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function formatFailedCase(r, state, includeStack) {
var msg = "Failed after " + r.tests + " tests and " + r.shrinks + " shrinks. ";
msg += "rngState: " + (r.rngState || state) + "; ";
msg += "Counterexample: " + r.counterexamplestr + "; ";
if (r.exc) {
- 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 too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return fnEqual;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return true;