Showing 128 of 288 total issues
Function updateIfPossible
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private updateIfPossible() {
const currentVersion =
localStorage.getItem(LatestChangesDialogService.VERSION_KEY) || "";
if (currentVersion.startsWith(this.UPDATE_PREFIX)) {
// Sometimes this is triggered multiple times for one update
Function resizeImage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function resizeImage(
file: File,
maxSize = 360,
): Promise<HTMLCanvasElement> {
const image = new Image();
Function selectDay
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
selectDay(newDate?: Date) {
if (!newDate) {
this.selectedDate = undefined;
this.selectedEvent = undefined;
this.selectedEventAttendance = undefined;
- 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 getRouteDataFromRouter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private getRouteDataFromRouter(path: string, routes: Route[]) {
// removing leading slash
path = path.replace(/^\//, "");
function isPathMatch(genericPath: string, path: 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 detectBrowser
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private detectBrowser(): Browser {
let browser: Browser;
const userAgent = this.window.navigator.userAgent;
if (/opera/i.test(userAgent)) {
browser = Browser.Opera;
- 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 resolveByManualEdit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public async resolveByManualEdit(diffStringToApply: string) {
const originalDoc = merge({}, this.doc);
const diffToApply = JSON.parse(diffStringToApply);
merge(this.doc, diffToApply);
- 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 countPercentage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private countPercentage(
matchingType: AttendanceLogicalStatus,
rounded: boolean = false,
) {
const calculatedStats = this.events
- 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 generateRowsFromActivityAttendance
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private generateRowsFromActivityAttendance(
att: ActivityAttendance,
from: Moment,
to: Moment,
): AttendanceWeekRow[] {
- 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 delete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async delete<E extends Entity>(
entityParam: E | E[],
navigate: boolean = false,
): Promise<boolean> {
let textForDeleteEntity = "";
- 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 getReadableValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getReadableValue(value: any): any {
if (isConfigurableEnum(value)) {
return value.label;
} else if (Array.isArray(value)) {
if (value.length > 0 && value.every((val) => value.indexOf(val) === 0)) {
- 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 getAttendanceArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private getAttendanceArray(
events: Note[],
includeSchool = false,
): AttendanceInfo[] {
const attendances: AttendanceInfo[] = [];
- 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 calculateAggregations
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private calculateAggregations(
aggregations: Aggregation[] = [],
data?: any[],
additionalValues: GroupByDescription[] = [],
): ReportRow[] {
- 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 transformEntityToDatabaseFormat
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public transformEntityToDatabaseFormat(
entity: Entity,
schema?: EntitySchema,
): any {
if (!schema) {
- 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 generateFormFieldStory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
editComponent,
defaultValue,
withTooltip = true,
additionalSchema = {},
additionalProviders = [],
Function testDatatype
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
dataType: D | (new (params: any) => D),
objectValue,
databaseValue,
additionalSchemaFieldConfig?: any,
additionalProviders?: any[],
Function generateEntities
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
generateEntities(): EventNote[] {
const data = [];
for (const activity of this.demoActivities.entities) {
for (
- 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 icon
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Input() set icon(icon: string) {
if (!icon) {
this._icon = undefined;
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 detectOS
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private detectOS(): OS {
let os: OS;
const userAgent = this.window.navigator.userAgent;
if (/iphone|ipad|ipod|macintosh/i.test(userAgent)) {
if (this.window.innerWidth < 1025) {
- 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 getAllDistances
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private getAllDistances(compareCoordinates: Coordinates[], e: Entity) {
const results: number[] = [];
for (const prop of this.config.coordinatesProperties) {
for (const coord of compareCoordinates) {
if (e[prop] && coord) {
- 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 migrateFormFieldConfigView2ViewComponent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const migrateFormFieldConfigView2ViewComponent: ConfigMigration = (
key,
configPart,
) => {
if (
- 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"