Showing 128 of 146 total issues
Function newProperties
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
newProperties: this.formBuilder.array([], (ctrl: FormArray) => {
const dups = new Map<string, Array<FormGroup>>();
if (this.properties) {
this.properties.controls.forEach((propctrl: FormGroup) => {
const key = (propctrl as FormGroup).controls['key'].value;
- 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
Open
return { ...state, actorCreateMode: action.payload };
Avoid too many return
statements within this function. Open
Open
return loreAdapter.addOne(payload, { ...state, loading: false });
Avoid too many return
statements within this function. Open
Open
return loreAdapter.removeOne(action.payload, { ...state, loading: false });
Avoid too many return
statements within this function. Open
Open
return cursor;
Avoid too many return
statements within this function. Open
Open
return frame;
Avoid too many return
statements within this function. Open
Open
return { ...state, loading: false };
Avoid too many return
statements within this function. Open
Open
return { ...frame, end: { ...frame.end, delta: action.payload } };
Avoid too many return
statements within this function. Open
Open
return { ...state, actorObjectSizeBias: action.payload };
Avoid too many return
statements within this function. Open
Open
return { ...state, sidebarOpen: !state.sidebarOpen };
Avoid too many return
statements within this function. Open
Open
return { ...frame, start: { ...frame.start, base: bakedStart, delta: undefined } };
Avoid too many return
statements within this function. Open
Open
return { ...state, loading: false };
Avoid too many return
statements within this function. Open
Open
return { ...state, debugMode: !state.debugMode };
Avoid too many return
statements within this function. Open
Open
return { ...state, cursor: cursorReducer(state.cursor, action) };
Avoid too many return
statements within this function. Open
Open
return state;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return { ...frame, end: { ...frame.end, base: action.payload || frame.end.base } };
Avoid too many return
statements within this function. Open
Open
return { ...frame, start: { ...frame.start, delta: action.payload } };
Avoid too many return
statements within this function. Open
Open
return {
...frame,
start: { ...frame.start, base: bakedStart, delta: undefined },
end: { ...frame.end, base: bakedEnd, delta: undefined }
};
Avoid too many return
statements within this function. Open
Open
return { ...frame, end: { ...frame.end, base: bakedEnd, delta: undefined } };