Showing 6 of 8 total issues
Function __call
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public __call(name: string, ...actualArgs: unknown[]): unknown {
const actualCalls = (this.actualCalls[name] = this.actualCalls[name] || [])
const index = actualCalls.length
const expectedCall = (this.expectedCalls[name] || [])[index]
Function expect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public expect<N extends string, R = unknown, A extends unknown[] = unknown[]>(
name: N,
retval: R,
args?: A,
predicate?: Predicate
- 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 __call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public __call(name: string, ...actualArgs: unknown[]): unknown {
const actualCalls = (this.actualCalls[name] = this.actualCalls[name] || [])
const index = actualCalls.length
const expectedCall = (this.expectedCalls[name] || [])[index]
- 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
Line length Open
[![npm](https://github.com/XPBytes/moxie/workflows/npm/badge.svg)](https://github.com/XPBytes/moxie/actions?query=workflow%3Anpm) [![NPM Package Version](https://badge.fury.io/js/@xpbytes%2Fmoxie.svg)](https://npmjs.org/package/@xpbytes/moxie) [![Maintainability](https://api.codeclimate.com/v1/badges/935646b9f014b9f9a983/maintainability)](https://codeclimate.com/github/XPBytes/moxie/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/935646b9f014b9f9a983/test_coverage)](https://codeclimate.com/github/XPBytes/moxie/test_coverage)
- Read upRead up
- Exclude checks
MD013 - Line length
Tags: line_length
Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)
This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.
This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.
You also have the option to exclude this rule for code blocks and tables. To
do this, set the code_blocks
and/or tables
parameters to false.
Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.
TODO found Open
// TODO: implement case equality
- Exclude checks
TODO found Open
// TODO: allow for === case equailty style matching later
- Exclude checks