Aam-Digital/ndb-core

View on GitHub

Showing 131 of 308 total issues

File config-fix.ts has 922 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Child } from "../../child-dev-project/children/model/child";
import { School } from "../../child-dev-project/schools/model/school";
import { ChildSchoolRelation } from "../../child-dev-project/children/model/childSchoolRelation";
import { defaultDateFilters } from "../basic-datatypes/date/date-range-filter/date-range-filter-panel/date-range-filter-panel.component";
import { EducationalMaterial } from "../../child-dev-project/children/educational-material/model/educational-material";
Severity: Major
Found in src/app/core/config/config-fix.ts - About 2 days to fix

    File data-aggregation.service.spec.ts has 674 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { TestBed } from "@angular/core/testing";
    
    import {
      Aggregation,
      DataAggregationService,
    Severity: Major
    Found in src/app/features/reporting/data-aggregation.service.spec.ts - About 1 day to fix

      File query.service.spec.ts has 608 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { TestBed, waitForAsync } from "@angular/core/testing";
      
      import {
        AttendanceInfo,
        AttendanceReport,
      Severity: Major
      Found in src/app/core/export/query.service.spec.ts - About 1 day to fix

        File config.service.spec.ts has 470 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { fakeAsync, TestBed, tick, waitForAsync } from "@angular/core/testing";
        import { ConfigService } from "./config.service";
        import { EntityMapperService } from "../entity/entity-mapper/entity-mapper.service";
        import { Config } from "./config";
        import { firstValueFrom, Subject } from "rxjs";
        Severity: Minor
        Found in src/app/core/config/config.service.spec.ts - About 7 hrs to fix

          File matching-entities.component.spec.ts has 449 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
            ComponentFixture,
            fakeAsync,
            flush,
            TestBed,

            Function calculateReport has 166 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              calculateReport: () => {
                return Promise.resolve([
                  {
                    header: { label: "Total # of children", result: 4 },
                    subRows: [
            Severity: Major
            Found in src/app/features/reporting/reporting/reporting.stories.ts - About 6 hrs to fix

              File handle-default-values.usecase.spec.ts has 421 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { fakeAsync, TestBed, tick } from "@angular/core/testing";
              
              import { HandleDefaultValuesUseCase } from "./handle-default-values.usecase";
              import { EntityMapperService } from "../entity-mapper/entity-mapper.service";
              import { CurrentUserSubject } from "../../session/current-user-subject";

                File data-transformation.service.spec.ts has 390 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { TestBed, waitForAsync } from "@angular/core/testing";
                
                import { DataTransformationService } from "./data-transformation.service";
                import { EntityMapperService } from "../../entity/entity-mapper/entity-mapper.service";
                import { Database } from "../../database/database";

                  File config-import-parser.service.spec.ts has 378 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { TestBed } from "@angular/core/testing";
                  
                  import { ConfigImportParserService } from "./config-import-parser.service";
                  import { EntityConfig } from "../../core/entity/entity-config";
                  import { ConfigService } from "../../core/config/config.service";
                  Severity: Minor
                  Found in src/app/features/config-setup/config-import-parser.service.spec.ts - About 5 hrs to fix

                    File matching-entities.component.ts has 337 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import {
                      ChangeDetectorRef,
                      Component,
                      ElementRef,
                      Input,

                      File entity-form.service.spec.ts has 330 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { TestBed, waitForAsync } from "@angular/core/testing";
                      
                      import { EntityFormService } from "./entity-form.service";
                      import {
                        FormControl,

                        File query.service.ts has 320 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { Injectable } from "@angular/core";
                        import { Entity, EntityConstructor } from "../entity/model/entity";
                        import { Note } from "../../child-dev-project/notes/model/note";
                        import { EventNote } from "../../child-dev-project/attendance/model/event-note";
                        import { EntityMapperService } from "../entity/entity-mapper/entity-mapper.service";
                        Severity: Minor
                        Found in src/app/core/export/query.service.ts - About 3 hrs to fix

                          Function testDatatype has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function testDatatype<D extends DefaultDatatype>(
                            dataType: D | (new (params: any) => D),
                            objectValue,
                            databaseValue,
                            additionalSchemaFieldConfig?: any,
                          Severity: Major
                          Found in src/app/core/entity/schema/entity-schema.service.spec.ts - About 3 hrs to fix

                            File basic-autocomplete.component.ts has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import {
                              Component,
                              ContentChild,
                              ElementRef,
                              EventEmitter,

                              File children.service.spec.ts has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { ChildrenService } from "./children.service";
                              import { EntityMapperService } from "../../core/entity/entity-mapper/entity-mapper.service";
                              import { ChildSchoolRelation } from "./model/childSchoolRelation";
                              import { Child } from "./model/child";
                              import { School } from "../schools/model/school";
                              Severity: Minor
                              Found in src/app/child-dev-project/children/children.service.spec.ts - About 3 hrs to fix

                                Function generate has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  async generate<T extends Entity>(
                                    filterConfigs: FilterConfig[],
                                    entityConstructor: EntityConstructor<T>,
                                    data: T[],
                                    onlyShowUsedOptions = false,
                                Severity: Minor
                                Found in src/app/core/filter/filter-generator/filter-generator.service.ts - About 3 hrs to fix

                                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

                                File attendance.service.spec.ts has 302 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import { TestBed, waitForAsync } from "@angular/core/testing";
                                
                                import { AttendanceService } from "./attendance.service";
                                import { EntityMapperService } from "../../core/entity/entity-mapper/entity-mapper.service";
                                import { Database } from "../../core/database/database";
                                Severity: Minor
                                Found in src/app/child-dev-project/attendance/attendance.service.spec.ts - About 3 hrs to fix

                                  File couchdb-file.service.spec.ts has 296 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import { fakeAsync, TestBed, tick } from "@angular/core/testing";
                                  
                                  import { CouchdbFileService } from "./couchdb-file.service";
                                  import {
                                    HttpClient,
                                  Severity: Minor
                                  Found in src/app/features/file/couchdb-file.service.spec.ts - About 3 hrs to fix

                                    File config-import-parser.service.ts has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { Injectable } from "@angular/core";
                                    import {
                                      EntityListConfig,
                                      GroupConfig,
                                    } from "../../core/entity-list/EntityListConfig";
                                    Severity: Minor
                                    Found in src/app/features/config-setup/config-import-parser.service.ts - About 3 hrs to fix

                                      Function transformRawDataToEntities has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        async transformRawDataToEntities(
                                          rawData: any[],
                                          entityType: string,
                                          columnMapping: ColumnMapping[],
                                        ): Promise<Entity[]> {
                                      Severity: Minor
                                      Found in src/app/core/import/import.service.ts - About 2 hrs to fix

                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language