Aam-Digital/ndb-core

View on GitHub

Showing 282 of 313 total issues

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

  it("should hide date range filter when sql report does not have these args", () => {
    const report = new ReportEntity();
    report.mode = "sql";
    component.reports = [report];

src/app/features/reporting/reporting/select-report/select-report.component.spec.ts on lines 35..44

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

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 mark relation with end date in the past as inactive", () => {
    const relation = new TimePeriod();
    relation.start = moment().subtract(1, "week").toDate();
    relation.end = moment().subtract(1, "day").toDate();
    expect(relation.isActive).toBeFalse();
src/app/core/entity-details/related-time-period-entities/time-period.spec.ts on lines 49..54

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

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 258 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

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

    @RouteTarget("EntityList")
    @Component({
      selector: "app-entity-list",
      templateUrl: "./entity-list.component.html",
      styleUrls: ["./entity-list.component.scss"],
    Severity: Minor
    Found in src/app/core/entity-list/entity-list/entity-list.component.ts - About 2 hrs to fix

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

      @Injectable({
        providedIn: "root",
      })
      export class QueryService {
        private entities: { [type: string]: { [id: string]: Entity } } = {};
      Severity: Minor
      Found in src/app/core/export/query.service.ts - About 2 hrs to fix

        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

          @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 44..52

        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

        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

        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

          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 entity-actions.service.ts has 251 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Injectable } from "@angular/core";
        import { EntityMapperService } from "../entity-mapper/entity-mapper.service";
        import { Entity } from "../model/entity";
        import { ConfirmationDialogService } from "../../common-components/confirmation-dialog/confirmation-dialog.service";
        import { MatSnackBar } from "@angular/material/snack-bar";
        Severity: Minor
        Found in src/app/core/entity/entity-actions/entity-actions.service.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: [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: "category", 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 258..274

            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: "category", 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 241..257

            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