alsatian-test/alsatian

View on GitHub

Showing 54 of 54 total issues

Function match has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

private match(
countIsNotCorrect: (count: number) => boolean,
callCount: number,
callCountName: string,
callCountType: SpyCallCountType,
Severity: Minor
Found in packages/alsatian/core/matchers/function-spy-matcher.ts - About 35 mins to fix

Similar blocks of code found in 4 locations. Consider refactoring.
Open

public greaterThan(minimumCallCount: number): FunctionSpyCallCountMatcher {
return this.match(
count => count <= minimumCallCount,
minimumCallCount,
"minimumCallCount",
Severity: Major
Found in packages/alsatian/core/matchers/function-spy-matcher.ts and 3 other locations - About 35 mins to fix
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 23..31
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 33..43
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 55..63

Similar blocks of code found in 4 locations. Consider refactoring.
Open

public exactly(expectedCallCount: number): FunctionSpyCallCountMatcher {
return this.match(
count => count !== expectedCallCount,
expectedCallCount,
"expectedCallCount",
Severity: Major
Found in packages/alsatian/core/matchers/function-spy-matcher.ts and 3 other locations - About 35 mins to fix
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 33..43
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 45..53
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 55..63

Similar blocks of code found in 4 locations. Consider refactoring.
Open

public lessThan(maximumCallCount: number): FunctionSpyCallCountMatcher {
return this.match(
count => count >= maximumCallCount,
maximumCallCount,
"maximumCallCount",
Severity: Major
Found in packages/alsatian/core/matchers/function-spy-matcher.ts and 3 other locations - About 35 mins to fix
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 23..31
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 33..43
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 45..53

Similar blocks of code found in 4 locations. Consider refactoring.
Open

public anythingBut(
unexpectedCallCount: number
): FunctionSpyCallCountMatcher {
return this.match(
count => count === unexpectedCallCount,
Severity: Major
Found in packages/alsatian/core/matchers/function-spy-matcher.ts and 3 other locations - About 35 mins to fix
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 23..31
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 45..53
packages/alsatian/core/matchers/function-spy-matcher.ts on lines 55..63

Avoid too many return statements within this function.
Open

return "failure";

    Function GetTestCases has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    function GetTestCases(
    caseArguments:
    | (() => IterableIterator<any> | Array<Array<any>>)
    | IterableIterator<any>
    | Array<Array<any>>
    Severity: Minor
    Found in packages/alsatian/core/decorators/test-cases-decorator.ts - About 25 mins to fix

    TODO found
    Open

    //TODO: confirm the above is still true

    TODO found
    Open

    //TODO: figure out why running with vscode extension doesn't work here (double fork perhaps?)

    TODO found
    Open

    //TODO: convert this to useEffect however since this is deferred would

    TODO found
    Open

    // TODO: This functionality will be removed in 5.0.0 where
    Severity: Minor
    Found in packages/alsatian/core/test-loader.ts by fixme

    TODO found
    Open

    //TODO: add error if no tsconfig resolved - this is not likely to be correct setup

    TODO found
    Open

    //TODO: tests already loaded here and are loaded again in `run.ts` could avoid double load for quicker running

    TODO found
    Open

    //TODO: this is likely inefficient and can be refactored to avoid loading the document multiple times
    Severity
    Category
    Status
    Source
    Language