Showing 22 of 32 total issues
Function deepEqual
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const deepEqual = (a, b) => {
if (
typeof a === 'object' &&
a != null &&
(typeof b === 'object' && b != null)
- 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 fixNames
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const fixNames = name => {
if (name === 'sceptile') {
return 'sceptille';
}
if (name === 'jirachi') {
- 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 fixNames
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
const fixNames = name => {
if (name === 'sceptile') {
return 'sceptille';
}
if (name === 'jirachi') {
Function selectColor
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const selectColor = name => {
switch (name) {
case 'normal':
return '#A8A77A';
case 'fire':
Function getLimitsFromGeneration
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getLimitsFromGeneration = generation => {
let limit;
let offset;
switch (generation) {
case 'all':
Function deepEqual
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const deepEqual = (a, b) => {
if (
typeof a === 'object' &&
a != null &&
(typeof b === 'object' && b != null)
Function withFetching
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const withFetching = getUrl => InnerComponent =>
class WithFetching extends Component {
constructor(props) {
super(props);
this.props = props;
- 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 too many return
statements within this function. Open
return a === b;
Avoid too many return
statements within this function. Open
return 'hooh';
Avoid too many return
statements within this function. Open
return 'deoxys';
Avoid too many return
statements within this function. Open
return 'cherim-overcast';
Avoid too many return
statements within this function. Open
return 'shellos-east';
Avoid too many return
statements within this function. Open
return 'gastrodon-east';
Avoid too many return
statements within this function. Open
return name;
Avoid too many return
statements within this function. Open
return `${name}-1`;
Avoid too many return
statements within this function. Open
return 'mimejr';
Avoid too many return
statements within this function. Open
return 'lickilicki';
Avoid too many return
statements within this function. Open
return `${name}-a`;
Avoid too many return
statements within this function. Open
return `${name}-normal`;
Avoid too many return
statements within this function. Open
return `${name}-plant`;