NGO-DB/ndb-core

View on GitHub

Showing 281 of 282 total issues

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/health-checkup/demo-data/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

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/health-checkup/demo-data/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

File config-fix.ts has 917 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

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

                  {
                    header: {
                      label: "Total # of children",
                      groupedBy: [{ property: "gender", 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 622..661

        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: "gender", 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 582..621

        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

          it("should anonymize and save several entities and show snackbar confirmation", async () => {
            // onAction is never called
            mockSnackBarRef.onAction.and.returnValues(NEVER);
            mockSnackBarRef.afterDismissed.and.returnValue(of(undefined));
        
        
        src/app/core/entity/entity-actions/entity-actions.service.spec.ts on lines 110..129

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

        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 delete several entities and show snackbar confirmation", async () => {
            // onAction is never called
            mockSnackBarRef.onAction.and.returnValues(NEVER);
            mockSnackBarRef.afterDismissed.and.returnValue(of(undefined));
        
        
        src/app/core/entity/entity-actions/entity-actions.service.spec.ts on lines 204..225

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

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

            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("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("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 2 locations. Consider refactoring.
            Open

            export const attendanceComponents: ComponentTuple[] = [
              [
                "AttendanceManager",
                () =>
                  import("./attendance-manager/attendance-manager.component").then(
            src/app/features/todos/todos.module.ts on lines 20..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 165.

            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

            const dynamicComponents: [string, AsyncComponent][] = [
              [
                "TodoList",
                () =>
                  import("./todo-list/todo-list.component").then(
            Severity: Major
            Found in src/app/features/todos/todos.module.ts and 1 other location - About 5 hrs to fix
            src/app/child-dev-project/attendance/attendance-components.ts on lines 3..46

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

            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

            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

            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";
              Severity
              Category
              Status
              Source
              Language