Showing 12 of 79 total issues
File Expectation.js
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
import has from 'has'
import tmatch from 'tmatch'
import assert from './assert'
import { isSpy } from './SpyUtils'
import {
Function exports
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (config) => {
const customLaunchers = {
BS_Chrome: {
base: 'BrowserStack',
os: 'Windows',
Expectation
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Expectation {
constructor(actual) {
this.actual = actual
if (isFunction(actual)) {
Function functionThrows
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const functionThrows = (fn, context, args, value) => {
try {
fn.apply(context, args)
} catch (error) {
if (value == null)
- 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 createSpy
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createSpy = (fn, restore = noop) => {
if (fn == null)
fn = noop
assert(
Function toInclude
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
toInclude(value, compareValues, message) {
if (typeof compareValues === 'string') {
message = compareValues
compareValues = null
}
Function toExclude
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
toExclude(value, compareValues, message) {
if (typeof compareValues === 'string') {
message = compareValues
compareValues = null
}
Function createSpy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const createSpy = (fn, restore = noop) => {
if (fn == null)
fn = noop
assert(
- 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
Function extend
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function extend(extension) {
if (Extensions.indexOf(extension) === -1) {
Extensions.push(extension)
for (const p in extension)
- 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 toExclude
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
toExclude(value, compareValues, message) {
if (typeof compareValues === 'string') {
message = compareValues
compareValues = null
}
- 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 toInclude
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
toInclude(value, compareValues, message) {
if (typeof compareValues === 'string') {
message = compareValues
compareValues = null
}
- 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"