Aam-Digital/ndb-core

View on GitHub

Showing 282 of 313 total issues

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

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 { todoDefaultConfigs } from "../../features/todos/model/todo-default-configs";
import { EntityDatatype } from "../basic-datatypes/entity/entity.datatype";
import { PLACEHOLDERS } from "../entity/schema/entity-schema-field";
Severity: Major
Found in src/app/core/config/config-fix.ts - About 3 days to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    export const heightRangeForAge = new Map<number, any>([
      [2, { min: 78, max: 91 }],
      [2.5, { min: 83, max: 97 }],
      [3, { min: 86, max: 101 }],
      [3.5, { min: 89, max: 105 }],
    src/app/child-dev-project/children/demo-data-generators/health-check/height-weight.ts on lines 40..75

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 528.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    export const weightRangeForAge = new Map<number, any>([
      [2, { min: 10, max: 15 }],
      [2.5, { min: 10, max: 16 }],
      [3, { min: 11, max: 17 }],
      [3.5, { min: 11, max: 19 }],
    src/app/child-dev-project/children/demo-data-generators/health-check/height-weight.ts on lines 3..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 528.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    File query.service.spec.ts has 612 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 data-aggregation.service.spec.ts has 579 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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  {
                    header: {
                      label: "Total # of children",
                      groupedBy: [{ property: "category", value: genders[2] }],
                      result: 4,
        Severity: Major
        Found in src/app/features/reporting/data-aggregation.service.spec.ts and 1 other location - About 7 hrs to fix
        src/app/features/reporting/data-aggregation.service.spec.ts on lines 527..566

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 208.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  {
                    header: {
                      label: "Total # of children",
                      groupedBy: [{ property: "category", value: genders[1] }],
                      result: 1,
        Severity: Major
        Found in src/app/features/reporting/data-aggregation.service.spec.ts and 1 other location - About 7 hrs to fix
        src/app/features/reporting/data-aggregation.service.spec.ts on lines 487..526

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 208.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        File matching-entities.component.spec.ts has 478 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 config.service.spec.ts has 424 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 6 hrs to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                it("should map columns to their respective property names automatically", () => {
                  const testMapping: ColumnMapping[] = [
                    { column: "name" },
                    { column: "phone" },
                    { column: "address" },
              src/app/core/import/import-column-mapping/import-column-mapping.service.spec.ts on lines 44..66

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 175.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                it("should map columns to their respective property names with different capitalization", () => {
                  const testMapping: ColumnMapping[] = [
                    { column: "Name" },
                    { column: "Phone" },
                    { column: "ADDRESS" },
              src/app/core/import/import-column-mapping/import-column-mapping.service.spec.ts on lines 19..41

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 175.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              export const mathLevels: ConfigurableEnumConfig<SkillLevel> =
                Ordering.imposeTotalOrdering([
                  EMPTY,
                  {
                    id: "Nothing",
              src/app/child-dev-project/children/demo-data-generators/aser/skill-levels.ts on lines 9..38

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 167.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              export const readingLevels: ConfigurableEnumConfig<SkillLevel> =
                Ordering.imposeTotalOrdering([
                  EMPTY,
                  {
                    id: "Nothing",
              src/app/child-dev-project/children/demo-data-generators/aser/skill-levels.ts on lines 40..69

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 167.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

              describe("AttendanceStatusSelectComponent", () => {
                let component: AttendanceStatusSelectComponent;
                let fixture: ComponentFixture<AttendanceStatusSelectComponent>;
              
                beforeEach(waitForAsync(() => {
              src/app/child-dev-project/children/child-details/grouped-child-attendance/grouped-child-attendance.component.spec.ts on lines 6..28
              src/app/core/ui/primary-action/primary-action.component.spec.ts on lines 6..25

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 166.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

              describe("GroupedChildAttendanceComponent", () => {
                let component: GroupedChildAttendanceComponent;
                let fixture: ComponentFixture<GroupedChildAttendanceComponent>;
              
                beforeEach(waitForAsync(() => {
              src/app/child-dev-project/attendance/attendance-status-select/attendance-status-select.component.spec.ts on lines 6..28
              src/app/core/ui/primary-action/primary-action.component.spec.ts on lines 6..25

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 166.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

              describe("PrimaryActionComponent", () => {
                let component: PrimaryActionComponent;
                let fixture: ComponentFixture<PrimaryActionComponent>;
              
                beforeEach(waitForAsync(() => {
              src/app/child-dev-project/attendance/attendance-status-select/attendance-status-select.component.spec.ts on lines 6..28
              src/app/child-dev-project/children/child-details/grouped-child-attendance/grouped-child-attendance.component.spec.ts on lines 6..28

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 166.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

              describe("EditBooleanComponent", () => {
                let component: EditBooleanComponent;
                let fixture: ComponentFixture<EditBooleanComponent>;
              
                beforeEach(async () => {
              src/app/core/basic-datatypes/string/edit-long-text/edit-long-text.component.spec.ts on lines 7..27
              src/app/core/basic-datatypes/string/edit-text/edit-text.component.spec.ts on lines 7..27

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 164.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

              describe("EditLongTextComponent", () => {
                let component: EditLongTextComponent;
                let fixture: ComponentFixture<EditLongTextComponent>;
              
                beforeEach(async () => {
              src/app/core/basic-datatypes/boolean/edit-boolean/edit-boolean.component.spec.ts on lines 7..27
              src/app/core/basic-datatypes/string/edit-text/edit-text.component.spec.ts on lines 7..27

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 164.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

              describe("EditTextComponent", () => {
                let component: EditTextComponent;
                let fixture: ComponentFixture<EditTextComponent>;
              
                beforeEach(async () => {
              src/app/core/basic-datatypes/boolean/edit-boolean/edit-boolean.component.spec.ts on lines 7..27
              src/app/core/basic-datatypes/string/edit-long-text/edit-long-text.component.spec.ts on lines 7..27

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 164.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language