Showing 29 of 32 total issues
Function displayItemByDate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private displayItemByDate(item: Item): void {
const boards = item.boards.filter((x: string) => x !== 'My Board');
const star = this.getStar(item);
const prefix = this.buildPrefix(item);
- 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 getRelativeHumanizedDate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const getRelativeHumanizedDate = function (
dueDate: Date,
now?: Date,
): string {
if (!now) now = new Date();
- 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 updatePriority
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async updatePriority(ids: string, priority: string): Promise<void> {
Renderer.instance.startLoading();
let level: TaskPriority;
try {
Avoid deeply nested control flow statements. Open
if (!target[key]) {
target[key] = {};
}
Function displayStats
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public displayStats(percent: number, complete: number, canceled: number, inProgress: number, pending: number, notes: number): void {
if (!Config.instance.get().displayProgressOverview) {
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 createTask
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public async createTask(
description: string,
boards?: string,
priority?: string,
dueDate?: string
- 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 buildTaskMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private buildTaskMessage(item: Task): string {
const message: Array<string> = [];
if (!item.isComplete && !item.isCanceled && item.priority > 1) {
message.push(this.getTaskColorMethod(item).underline(item.description));
- 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 parsedDate;
Avoid too many return
statements within this function. Open
return undefined;