Showing 128 of 288 total issues
Function processToken
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private processToken(token: string): SessionInfo {
if (!token) {
throw new Error("No token received from Keycloak");
}
- 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 applyUpdate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function applyUpdate<T extends Entity>(
entities: T[],
next: UpdatedEntity<T>,
addIfMissing: boolean = true,
): T[] {
- 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 anonymize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async anonymize<E extends Entity>(entityParam: E | E[]) {
let entities = Array.isArray(entityParam) ? entityParam : [entityParam];
let textForAnonymizeEntity = "";
if (entities.length > 1) {
- 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 anonymizeEntity
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async anonymizeEntity(entity: Entity): Promise<CascadingActionResult> {
if (!entity.getConstructor().hasPII) {
// entity types that are generally without PII by default retain all fields
// this should only be called through a cascade action anyway
return new CascadingActionResult();
- 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 transformDatabaseToEntityFormat
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public transformDatabaseToEntityFormat<T = Entity>(
data: any,
schema: EntitySchema,
): T {
const transformed = {};
- 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 order === "asc" ? 1 : -1;
Avoid too many return
statements within this function. Open
return entities;
Function getDaysSinceLastNoteOfEachEntity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public async getDaysSinceLastNoteOfEachEntity(
entityType = Child.ENTITY_TYPE,
forLastNDays: number = 30,
): Promise<Map<string, number>> {
const startDay = moment().subtract(forLastNDays, "days");
- 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 parseImportDefinition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
parseImportDefinition(
configRaw: ConfigFieldRaw[],
entityName: string,
includingDefaultConfigs: boolean,
): GeneratedConfig {
- 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 generateSchema
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
generateSchema(): SqsSchema {
const tables: SqlTables = {};
for (const [name, ctr] of this.entities.entries()) {
tables[name] = {};
for (const [attr, attrSchema] of ctr.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 setEntityConfig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private setEntityConfig(newConfig: Config) {
const entityConfigKey =
EntityConfigService.PREFIX_ENTITY_CONFIG + this.entityType;
// init config if not present
- 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 columnsToDisplay
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Input() set columnsToDisplay(value: string[]) {
if (!value || value.length === 0) {
value = (this._customColumns ?? this._columns).map((c) => c.id);
}
value = value.filter((c) => !c.startsWith("__")); // remove internal action columns
- 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 generateRows
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private generateRows(
data: any[],
config: ExportColumnConfig[],
from: Date,
to: 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 ngOnChanges
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ngOnChanges(changes: { [key in keyof this]?: any }) {
if (changes.valueMapper) {
this._options.forEach(
(opt) => (opt.asValue = this.valueMapper(opt.initial)),
);
- 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 getActivitiesForChild
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async getActivitiesForChild(childId: string): Promise<RecurringActivity[]> {
const activities = await this.dbIndexing.queryIndexDocs(
RecurringActivity,
"activities_index/by_participant",
childId,
- 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 makeCustomMatcher
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function makeCustomMatcher<T>(
condition: (actual: T, ...expected: any[]) => boolean,
compareMessage: (actual: T, ...expected: any[]) => string,
negativeCompareMessage: (actual: T, ...expected: any[]) => string,
): jasmine.CustomMatcher {
- 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 addMarker
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private addMarker(m: L.Marker, highlighted: boolean = false) {
m.addTo(this.map);
const entity = m["entity"] as Entity;
if (highlighted || entity) {
const degree = entity ? getHueForEntity(entity) : "145";
- 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 initColumnGroups
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private initColumnGroups(columnGroup?: ColumnGroupsConfig) {
if (columnGroup && columnGroup.groups.length > 0) {
this.groups = columnGroup.groups;
this.defaultColumnGroup =
columnGroup.default || columnGroup.groups[0].name;
- 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 applyTextToCreatedEntity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function applyTextToCreatedEntity(entity: Entity, input: string) {
const toStringFields = entity.getConstructor().toStringAttributes;
if (!toStringFields || toStringFields.length < 1) {
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 loadActivities
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async loadActivities() {
this.allActivities = await this.entityMapper
.loadType(RecurringActivity)
.then((res) => res.filter((a) => a.isActive));
- 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"