Showing 7 of 22 total issues
Function exports
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = env => {
const devMode = 'development';
const mode = env.NODE_ENV || devMode;
const isDevMode = mode === devMode;
const entryPath = path.resolve(__dirname, isDevMode ? 'demo' : 'src');
Function Main
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Main = () => {
const [
disabledDecimal,
setDecimalDisabled,
] = useState(false);
File index.jsx
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @flow
import React from 'react';
type NumVal = string | number;
type ParseFunc = (NumVal) => number;
Function shouldComponentUpdate
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
shouldComponentUpdate(nextProps: Props) {
const propsCopy: Object = { ...this.props };
const {
className,
Function shouldComponentUpdate
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
shouldComponentUpdate(nextProps: Props) {
const propsCopy: Object = { ...this.props };
const {
className,
- 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 constructor
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(props: Props, context: null) {
super(props, context);
this.propsOnBlur = getEvent(props.onBlur);
this.propsOnChange = getEvent(props.onChange);
this.propsOnError = getEvent(props.onError);
Function getExtremum
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
const getExtremum = (attr: string, val: ?NumVal, parseFunc: ParseFunc, dDecimal?: boolean) => {
if (typeof val === 'string' || typeof val === 'number') {
const pVal = parseFunc(val);
if (Number.isNaN(pVal)) {
- 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"