MichaReiser/speedy.js

View on GitHub
packages/compiler/src/code-generation/code-generation-context-mixin.ts

Summary

Maintainability
A
55 mins
Test Coverage

Function value has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    value(this: CodeGenerationContext, value: llvm.Value, type: ts.Type): Value {
        const symbol = type.getSymbol();

        if (type.flags & (ts.TypeFlags.BooleanLike | ts.TypeFlags.NumberLike | ts.TypeFlags.IntLike)) {
            return new Primitive(value, type);
Severity: Minor
Found in packages/compiler/src/code-generation/code-generation-context-mixin.ts - About 55 mins to fix

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

TODO found
Open

                // TODO Objekt erstellen und dann methode

Interface has only a call signature — use type CodeGenerationContextConstructor = new (...args: any[]) => CodeGenerationContext; instead.
Open

    new (...args: any[]): CodeGenerationContext;

Rule: callable-types

An interface or literal type with just a call signature can be written as a function type.

Rationale

style

Notes
  • TypeScript Only
  • Has Fix

Config

Not configurable.

For more information see this page.

There are no issues that match your filters.

Category
Status