Showing 100 of 340 total issues
Function onDrop
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@HostListener('drop', ['$event']) public onDrop(evt) {
evt.preventDefault();
evt.stopPropagation();
this.dragover = false;
const files = evt.dataTransfer.files;
- 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 onValidationError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
onValidationError(error: any): void {
const noControlErrors = [];
for (const e of error['errors']) {
// getterからformControllを取得
const control: FormControl | FormGroup = this[e.param];
- 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 textFormat
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
textFormat($event) {
if ($event.keyCode === 9) {
$event.preventDefault();
this.adjustIndent($event);
return;
- 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 scrollToElement
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
scrollToElement(element: Element) {
if (element) {
element.scrollIntoView();
if (window && window.scrollBy) {
- 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 adapter.addAll(action.payload.drafts, {...state, loading: false});
Avoid too many return
statements within this function. Open
return Object.assign({}, {...state, loading: false} );
Avoid too many return
statements within this function. Open
return Object.assign({}, {...state, loading: true} );
Avoid too many return
statements within this function. Open
return Object.assign({}, {...state, loading: false} );
Avoid too many return
statements within this function. Open
return Object.assign({}, {...state, loading: true} );
Avoid too many return
statements within this function. Open
return adapter.updateOne(action.payload.draft, {...state, loading: false});
Avoid too many return
statements within this function. Open
return adapter.removeOne(action.payload.draft._id, {...state, loading: false});
Avoid too many return
statements within this function. Open
return Object.assign({}, {...state, loadingVote: true});
Avoid too many return
statements within this function. Open
return { dateFrom, dateTo };
Avoid too many return
statements within this function. Open
return Object.assign({}, {...state, loading: false} );
Avoid too many return
statements within this function. Open
return Object.assign({}, {...state });
Avoid too many return
statements within this function. Open
return Object.assign({}, {
...state,
article: {
...state.article,
vote: action.payload.vote
Avoid too many return
statements within this function. Open
return Object.assign({}, {...state, loadingVote: false} );
Avoid too many return
statements within this function. Open
return adapter.addMany(action.payload.drafts, state);
Avoid too many return
statements within this function. Open
return Object.assign({}, {...state, loading: true} );
Avoid too many return
statements within this function. Open
return adapter.addOne(action.payload.article, {
...state,
loading: false
});