Showing 9 of 9 total issues
Function containerFactory
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function containerFactory(
graph: StrictGraph = {},
libOptions?: Partial<Options>,
graphLookup?: GraphLookup): Container {
Function resolveDependencies
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
const resolveDependencies: ResolveDependencies = (
rootKey,
rootDeclaration,
declarationLookup,
handleCircular,
- 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 containerFactory
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export default function containerFactory(
graph: StrictGraph = {},
libOptions?: Partial<Options>,
graphLookup?: GraphLookup): Container {
- 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 resolveDependencies
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
const resolveDependencies: ResolveDependencies = (
rootKey,
rootDeclaration,
declarationLookup,
handleCircular,
Function get
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
get(requestedKey) {
// If the key cannot be found in the graph, fail
const maybeDeclaration = graph[requestedKey];
if (!maybeDeclaration) {
Function makeSinglyLinkedList
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function makeSinglyLinkedList<T>(initialValues?: T[]) {
let head: SinglyLinkedListNode<T> | null = null;
let size: number = 0;
const singlyLinkedList: SinglyLinkedList<T> = {
Function makeSinglyLinkedList
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function makeSinglyLinkedList<T>(initialValues?: T[]) {
let head: SinglyLinkedListNode<T> | null = null;
let size: number = 0;
const singlyLinkedList: SinglyLinkedList<T> = {
- 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 deeply nested control flow statements. Open
if (!handleCircular) {
return {
kind: 'CircularDependencyFailure',
message: `"${key}" has circular dependency "${childkey}"`,
value: { history }
Function ensureStrictGraph
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function ensureStrictGraph(graph: StringIndexable): StrictGraph {
const strictGraph: StrictGraph = {};
const keys = Object.keys(graph);
for (const key of keys) {
- 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"