NGO-DB/ndb-core

View on GitHub

Showing 287 of 288 total issues

EntitiesTableComponent has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

@UntilDestroy()
@Component({
  selector: "app-entities-table",
  standalone: true,
  imports: [

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

      @Input() set entities(entities: Entity[]) {
        if (!entities) {
          return;
        }
        this.clearMarkers(this.markers);
    Severity: Major
    Found in src/app/features/location/map/map.component.ts and 1 other location - About 2 hrs to fix
    src/app/features/location/map/map.component.ts on lines 43..51

    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 98.

    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

      @Input() set marked(coordinates: Coordinates[]) {
        if (!coordinates) {
          return;
        }
        this.clearMarkers(this.markers);
    Severity: Major
    Found in src/app/features/location/map/map.component.ts and 1 other location - About 2 hrs to fix
    src/app/features/location/map/map.component.ts on lines 55..63

    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 98.

    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

      beforeEach(async () => {
        await TestBed.configureTestingModule({
          imports: [SetupWizardButtonComponent],
          providers: [
            { provide: EntityMapperService, useValue: mockEntityMapper() },
    src/app/core/admin/setup-wizard/setup-wizard.component.spec.ts on lines 25..36

    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 97.

    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

    describe("ComingSoonDialogService", () => {
      let service: ComingSoonDialogService;
    
      beforeEach(() => {
        TestBed.configureTestingModule({
    src/app/core/common-components/confirmation-dialog/confirmation-dialog.service.spec.ts on lines 6..16

    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 97.

    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

    describe("ConfirmationDialogService", () => {
      let service: ConfirmationDialogService;
      beforeEach(() => {
        TestBed.configureTestingModule({ imports: [MatDialogModule] });
        service = TestBed.inject(ConfirmationDialogService);
    src/app/features/coming-soon/coming-soon-dialog.service.spec.ts on lines 6..19

    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 97.

    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

      beforeEach(async () => {
        await TestBed.configureTestingModule({
          imports: [SetupWizardComponent],
          providers: [
            { provide: EntityMapperService, useValue: mockEntityMapper() },
    src/app/core/admin/setup-wizard/setup-wizard-button/setup-wizard-button.component.spec.ts on lines 18..29

    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 97.

    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

      valueToEntityFormat(
        value: any,
        schemaField: EntitySchemaField,
        dataObject?: any,
      ) {
    Severity: Major
    Found in src/app/core/entity/schema/entity-schema.service.ts and 1 other location - About 2 hrs to fix
    src/app/core/entity/schema/entity-schema.service.ts on lines 191..209

    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 96.

    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

      valueToDatabaseFormat(
        value: any,
        schemaField: EntitySchemaField,
        entity?: Entity,
      ) {
    Severity: Major
    Found in src/app/core/entity/schema/entity-schema.service.ts and 1 other location - About 2 hrs to fix
    src/app/core/entity/schema/entity-schema.service.ts on lines 217..235

    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 96.

    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 session-manager.service.spec.ts has 252 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     *     This file is part of ndb-core.
     *
     *     ndb-core is free software: you can redistribute it and/or modify
     *     it under the terms of the GNU General Public License as published by
    Severity: Minor
    Found in src/app/core/session/session-service/session-manager.service.spec.ts - About 2 hrs to fix

      File pouch-database.ts has 251 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       *     This file is part of ndb-core.
       *
       *     ndb-core is free software: you can redistribute it and/or modify
       *     it under the terms of the GNU General Public License as published by
      Severity: Minor
      Found in src/app/core/database/pouch-database.ts - About 2 hrs to fix

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

        import { Injectable } from "@angular/core";
        import { EntityMapperService } from "../../core/entity/entity-mapper/entity-mapper.service";
        import moment from "moment";
        import { RecurringActivity } from "./model/recurring-activity";
        import { ActivityAttendance } from "./model/activity-attendance";
        Severity: Minor
        Found in src/app/child-dev-project/attendance/attendance.service.ts - About 2 hrs to fix

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

            beforeEach(async () => {
              await TestBed.configureTestingModule({
                imports: [EntityFieldsMenuComponent, FontAwesomeTestingModule],
                providers: [{ provide: EntityFormService, useValue: null }],
              }).compileComponents();
          src/app/features/todos/recurring-interval/custom-interval/custom-interval.component.spec.ts on lines 11..20

          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 95.

          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

            beforeEach(async () => {
              await TestBed.configureTestingModule({
                imports: [CustomIntervalComponent, NoopAnimationsModule],
                providers: [{ provide: ConfigService, useValue: null }],
              }).compileComponents();
          src/app/core/common-components/entity-fields-menu/entity-fields-menu.component.spec.ts on lines 11..20

          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 95.

          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",
                        values: ["christian"],
                        result: 3,
          Severity: Major
          Found in src/app/features/reporting/reporting/reporting.stories.ts and 1 other location - About 1 hr to fix
          src/app/features/reporting/reporting/reporting.stories.ts on lines 97..121

          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 93.

          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",
                            values: ["christian"],
                            result: 2,
          Severity: Major
          Found in src/app/features/reporting/reporting/reporting.stories.ts and 1 other location - About 1 hr to fix
          src/app/features/reporting/reporting/reporting.stories.ts on lines 32..56

          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 93.

          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: "gender", value: genders[2] }],
                        result: 1,
          Severity: Major
          Found in src/app/features/reporting/data-aggregation.service.spec.ts and 1 other location - About 1 hr to fix
          src/app/features/reporting/data-aggregation.service.spec.ts on lines 239..255

          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 92.

          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: "gender", value: genders[1] }],
                        result: 2,
          Severity: Major
          Found in src/app/features/reporting/data-aggregation.service.spec.ts and 1 other location - About 1 hr to fix
          src/app/features/reporting/data-aggregation.service.spec.ts on lines 256..272

          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 92.

          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

          Function generateFormFieldStory has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function generateFormFieldStory<T>(
            editComponent,
            defaultValue,
            withTooltip = true,
            additionalSchema = {},
          Severity: Minor
          Found in src/app/core/entity/default-datatype/edit-component-story-utils.ts - About 1 hr to fix

            Function createNotesIndex has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              private async createNotesIndex(): Promise<any> {
                const designDoc = {
                  _id: "_design/notes_index",
                  views: {
                    note_child_by_date: {
            Severity: Minor
            Found in src/app/child-dev-project/children/children.service.ts - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language