Showing 4 of 6 total issues
Function findBalance
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const findBalance = (int) => {
const letsStart = (newInt) => {
const arr = `${newInt}`.split('');
arr.sort();
const iter = (newNum, i) => {
- 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 makeGame
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const makeGame = (gameRules, gameData) => {
welcomeGame(gameRules);
const getName = askName();
printHello(getName);
if (gameData) {
- 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 progressGame
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const progressGame = () => {
const rules = 'What number is missing in this progression?';
const makeData = () => {
const pLength = 10;
const step = makeRandNum(2, 9);
- 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 calcGame
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const calcGame = () => {
const rules = 'What is the result of the expression?';
const makeData = () => {
const currrentDigit1 = makeRandNum(0, 99);
const currrentDigit2 = makeRandNum(0, 99);
- 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"