Showing 9 of 9 total issues
Function getStringList
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function* getStringList(
strings: Iterable<string>,
transform: (s: string) => string,
) {
for (const str of strings) {
- 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 addWord
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function addWord(trie: Trie, word: string, value?: unknown) {
let current = trie;
const context = { i: 0, char: '' };
const synonymTrie = trie.s;
const transform = getTrieTransform(trie);
Function getLastPerfectMatch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function getLastPerfectMatch(
processedSynonyms: TrieParameters | undefined,
word: string,
context: { i: number; char: string },
) {
- 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 addWord
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function addWord(trie: Trie, word: string, value?: unknown) {
let current = trie;
const context = { i: 0, char: '' };
const synonymTrie = trie.s;
const transform = getTrieTransform(trie);
- 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 getQueue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getQueue<T>(): Queue<T> {
let first: QueueNode<T> | undefined;
let last: QueueNode<T> | undefined;
return {
hasItems() {
- 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 resolveValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function* resolveValue<TValue>(
value: TValue,
transform: (s: string) => string,
callback: typeof iterate,
): Iterable<string> {
- 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 processCharSynonyms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function processCharSynonyms(
synonymChars: string[][],
options?: TrieOptions,
): TrieParameters {
const set = new Set<string>();
- 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 createArrTrie
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function createArrTrie(list: string[]) {
const trie: ArrayTrie = Array(TOTAL_LETTERS);
for (const item of list) {
let current = trie;
- 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 treatOptions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function treatOptions<TValue>(
options: IteratingOptions<TValue>,
trie: Trie<TValue>,
) {
const [prefixes, count] = getPrefixTrie(options.prefixes, trie);
- 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"