Showing 127 of 282 total issues
Function parseFieldDefinition
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private parseFieldDefinition(
fieldDef: ConfigFieldRaw,
entityType: string,
): { id: string; schema: EntitySchemaField } {
const fieldId = fieldDef.id ?? generateIdFromLabel(fieldDef.label);
Function initSideDetails
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async initSideDetails(
side: MatchingSideConfig,
sideIndex: number,
): Promise<MatchingSide> {
const newSide = Object.assign({}, side) as MatchingSide; // we are transforming it into this type here
Function generateOrUpdateDetailsViewConfig
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private generateOrUpdateDetailsViewConfig(
fieldDef: ConfigFieldRaw,
entityType: string,
fieldId: 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 cascadeActionToRelatedEntities
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected async cascadeActionToRelatedEntities(
entity: Entity,
compositeAction: (
relatedEntity: Entity,
refField?: 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 generateEntities
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public generateEntities(): Note[] {
const data = [];
for (const child of this.demoChildren.entities) {
if (!child.isActive) {
Function calculateGroupBy
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private calculateGroupBy(
properties: string[],
aggregations: any[],
label: string,
data: any[],
Function initSettings
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private initSettings() {
this.fieldIdForm = this.fb.control(this.fieldId, {
validators: [Validators.required],
asyncValidators: [
uniqueIdValidator(Array.from(this.entityType.schema.keys())),
Function createMatch
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async createMatch() {
const newMatchEntity = new (this.entityRegistry.get(
this.onMatch.newEntityType,
))();
Function createEventsIndex
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private createEventsIndex(): Promise<void> {
const designDoc = {
_id: "_design/events_index",
views: {
by_date: {
Function transformRawDataToEntities
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
async transformRawDataToEntities(
rawData: any[],
entityType: string,
columnMapping: ColumnMapping[],
): Promise<Entity[]> {
Function selectDay
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
selectDay(newDate?: Date) {
if (!newDate) {
this.selectedDate = undefined;
this.selectedEvent = undefined;
this.selectedEventAttendance = undefined;
Function generateOrUpdateDetailsViewConfig
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private generateOrUpdateDetailsViewConfig(
fieldDef: ConfigFieldRaw,
entityType: string,
fieldId: string,
) {
Function recalculateStats
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
recalculateStats() {
this.individualStatusTypeCounts = new Map();
this.individualLogicalStatusCounts = new Map();
for (const event of 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 alignAvailableAndSelectedEntities
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private async alignAvailableAndSelectedEntities(availableEntities: E[]) {
if (this.form.value === null || this.form.value === 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 generateEntities
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public generateEntities(): Note[] {
const data = [];
for (const child of this.demoChildren.entities) {
if (!child.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"
Further reading
Function ngOnInit
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
async ngOnInit() {
if (!this.entityToDisplay) {
this.entityId = this.entityId ?? this.value;
this.entityType = (this.entityId ?? "").includes(":")
? Entity.extractTypeFromId(this.entityId)
- 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 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private countPercentage(
matchingType: AttendanceLogicalStatus,
rounded: boolean = false,
) {
const calculatedStats = this.events
Function generateEntities
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateEntities(): School[] {
const data = [];
for (let i = 1; i <= this.config.count; i++) {
const school = new School(String(i));
Function generateChildEntities
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateChildEntities(): Child[] {
const data = [];
const a1 = new Child("1");
a1.name = "Arjun A.";
Function anonymizeEntity
has 29 lines of code (exceeds 25 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();