Showing 11 of 15 total issues
Function getWords
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private getWords(): void {
let filtering: boolean = false;
this.route
.queryParamMap
Function getQueryParams
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
private getQueryParams(): Subscription {
return this.route
.queryParamMap
.pipe(
take(1),
Function ngOnChanges
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnChanges(changes: SimpleChanges): void {
if (!this.stats) {
return;
}
Function getFilterHttpParams
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private getFilterHttpParams(wordFilter: WordFilter): HttpParams | undefined {
if (!wordFilter) {
return undefined;
}
Function getFilterLabels
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getFilterLabels(qParamsMap: ParamMap): string[] {
let filters: string[] = [];
const word: string = qParamsMap.get('word');
if (!!word?.trim()) {
Function onBtnClick
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
onBtnClick(cancel?: boolean): void {
if (cancel) {
this.form.reset();
this.secondBtnClick.emit();
this.selectedPos = undefined;
Function getMessage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getMessage(e: HttpErrorResponse): string {
const status: number = e.status;
const apiError: ApiErrorResponse = e.error;
let message = '';
Function setSelectedPos
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private setSelectedPos(partsOfSpeech: string[]): void {
if (!partsOfSpeech || partsOfSpeech.length === 0) {
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 getFilterLabels
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static getFilterLabels(qParamsMap: ParamMap): string[] {
let filters: string[] = [];
const word: string = qParamsMap.get('word');
if (!!word?.trim()) {
- 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 ngOnChanges
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ngOnChanges(changes: SimpleChanges): void {
if (!this.stats) {
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 filter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
filter(): void {
const queryParams: QueryParamFilters = {};
const { word, definition, origin, example, note } = this.form.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"