Showing 36 of 74 total issues
Function reducer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const reducer: EddyReducer<State, Action> = (
state = initialState('/', null),
action,
) => {
switch (action.type) {
- 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 runCommands
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const runCommands = <A extends Action>(
run: ResultRight<A>[],
dispatch: (action: A) => A,
) => {
for (const cmd of run) {
- 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 reducer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const reducer: EddyReducer<State, Action> = (
state = initialState('/', null),
action,
) => {
switch (action.type) {
- 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 View
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const View: React.FC<State> = ({ status, paths, results, error }) => {
switch (status) {
case 'init':
case 'globbing':
case 'formatting':
- 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 state;
Avoid too many return
statements within this function. Open
return {
...state,
step: 'complete',
result: action.payload.result,
};
Avoid too many return
statements within this function. Open
return {
...state,
step: 'cancelled',
};
Avoid too many return
statements within this function. Open
return <Built results={props.results!} watch={!!props.watch} />;
Avoid too many return
statements within this function. Open
return externalModules.includes(packageName);
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return state;
Avoid too many return
statements within this function. Open
return {
...state,
step: 'error',
error: action.payload.error,
};
Avoid too many return
statements within this function. Open
return (
<BuildErrors watch={!!props.watch} errors={[...errors, ...warnings]} />
);
Function View
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
}> = props => {
if (props.rc == null) {
return <RCNotLoaded />;
}
- 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 jestPlugin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const jestPlugin = ({
Kefir,
}: {
Kefir: typeof import('kefir').default;
}): Helpers => {
- 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"