OwenKelvin/Angular-School-Management-System

View on GitHub

Showing 218 of 218 total issues

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

describe('NewSubjectCategoryService', () => {
  beforeEach(() => TestBed.configureTestingModule({
    imports: [HttpClientTestingModule]
  }));

src/app/core/services/countries/allowed-phone-numbers.service.spec.ts on lines 6..19
src/app/core/services/gender/gender.service.spec.ts on lines 6..15
src/app/core/services/religion/religion.service.spec.ts on lines 6..17
src/app/pages/academic-year/services/subjects.service.spec.ts on lines 6..15
src/app/pages/admissions/services/guardian-details/guardian.service.spec.ts on lines 6..15
src/app/pages/admissions/services/studen-details/student-details.service.spec.ts on lines 6..15
src/app/pages/admissions/services/student-id-number/student-id-number.service.spec.ts on lines 6..17
src/app/pages/admissions/services/submit-student-identification.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/class-levels/services/class-level-category.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/class-levels/services/class-level.service.spec.ts on lines 8..19
src/app/pages/curriculum-maintenance/subject-category/services/subject-category.service.spec.ts on lines 6..17
src/app/pages/curriculum-maintenance/units/services/unit-level.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/units/services/unit.service.spec.ts on lines 6..17
src/app/shared/services/users/users.service.spec.ts on lines 6..15

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

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 15 locations. Consider refactoring.
Open

describe('AllowedPhoneNumbersService', () => {
  beforeEach(() =>
    TestBed.configureTestingModule({
      imports: [HttpClientTestingModule]
    })
src/app/core/services/gender/gender.service.spec.ts on lines 6..15
src/app/core/services/religion/religion.service.spec.ts on lines 6..17
src/app/pages/academic-year/services/subjects.service.spec.ts on lines 6..15
src/app/pages/admissions/services/guardian-details/guardian.service.spec.ts on lines 6..15
src/app/pages/admissions/services/studen-details/student-details.service.spec.ts on lines 6..15
src/app/pages/admissions/services/student-id-number/student-id-number.service.spec.ts on lines 6..17
src/app/pages/admissions/services/submit-student-identification.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/class-levels/services/class-level-category.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/class-levels/services/class-level.service.spec.ts on lines 8..19
src/app/pages/curriculum-maintenance/subject-category/services/new-subject-category.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/subject-category/services/subject-category.service.spec.ts on lines 6..17
src/app/pages/curriculum-maintenance/units/services/unit-level.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/units/services/unit.service.spec.ts on lines 6..17
src/app/shared/services/users/users.service.spec.ts on lines 6..15

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

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 15 locations. Consider refactoring.
Open

describe('ClassLevelService', () => {
  beforeEach(() =>
    TestBed.configureTestingModule({
      imports: [ HttpClientTestingModule ]
    })
src/app/core/services/countries/allowed-phone-numbers.service.spec.ts on lines 6..19
src/app/core/services/gender/gender.service.spec.ts on lines 6..15
src/app/core/services/religion/religion.service.spec.ts on lines 6..17
src/app/pages/academic-year/services/subjects.service.spec.ts on lines 6..15
src/app/pages/admissions/services/guardian-details/guardian.service.spec.ts on lines 6..15
src/app/pages/admissions/services/studen-details/student-details.service.spec.ts on lines 6..15
src/app/pages/admissions/services/student-id-number/student-id-number.service.spec.ts on lines 6..17
src/app/pages/admissions/services/submit-student-identification.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/class-levels/services/class-level-category.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/subject-category/services/new-subject-category.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/subject-category/services/subject-category.service.spec.ts on lines 6..17
src/app/pages/curriculum-maintenance/units/services/unit-level.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/units/services/unit.service.spec.ts on lines 6..17
src/app/shared/services/users/users.service.spec.ts on lines 6..15

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

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 15 locations. Consider refactoring.
Open

describe('ClassLevelCategoryService', () => {
  beforeEach(() => TestBed.configureTestingModule({
    imports: [HttpClientTestingModule]
  }));

src/app/core/services/countries/allowed-phone-numbers.service.spec.ts on lines 6..19
src/app/core/services/gender/gender.service.spec.ts on lines 6..15
src/app/core/services/religion/religion.service.spec.ts on lines 6..17
src/app/pages/academic-year/services/subjects.service.spec.ts on lines 6..15
src/app/pages/admissions/services/guardian-details/guardian.service.spec.ts on lines 6..15
src/app/pages/admissions/services/studen-details/student-details.service.spec.ts on lines 6..15
src/app/pages/admissions/services/student-id-number/student-id-number.service.spec.ts on lines 6..17
src/app/pages/admissions/services/submit-student-identification.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/class-levels/services/class-level.service.spec.ts on lines 8..19
src/app/pages/curriculum-maintenance/subject-category/services/new-subject-category.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/subject-category/services/subject-category.service.spec.ts on lines 6..17
src/app/pages/curriculum-maintenance/units/services/unit-level.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/units/services/unit.service.spec.ts on lines 6..17
src/app/shared/services/users/users.service.spec.ts on lines 6..15

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

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 15 locations. Consider refactoring.
Open

describe('SubmitStudentIdentificationService', () => {
  beforeEach(() => TestBed.configureTestingModule({
    imports: [HttpClientTestingModule]
  }));

src/app/core/services/countries/allowed-phone-numbers.service.spec.ts on lines 6..19
src/app/core/services/gender/gender.service.spec.ts on lines 6..15
src/app/core/services/religion/religion.service.spec.ts on lines 6..17
src/app/pages/academic-year/services/subjects.service.spec.ts on lines 6..15
src/app/pages/admissions/services/guardian-details/guardian.service.spec.ts on lines 6..15
src/app/pages/admissions/services/studen-details/student-details.service.spec.ts on lines 6..15
src/app/pages/admissions/services/student-id-number/student-id-number.service.spec.ts on lines 6..17
src/app/pages/curriculum-maintenance/class-levels/services/class-level-category.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/class-levels/services/class-level.service.spec.ts on lines 8..19
src/app/pages/curriculum-maintenance/subject-category/services/new-subject-category.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/subject-category/services/subject-category.service.spec.ts on lines 6..17
src/app/pages/curriculum-maintenance/units/services/unit-level.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/units/services/unit.service.spec.ts on lines 6..17
src/app/shared/services/users/users.service.spec.ts on lines 6..15

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

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 15 locations. Consider refactoring.
Open

describe('GuardianService', () => {
  beforeEach(() => TestBed.configureTestingModule({
    imports: [HttpClientTestingModule]
  }));

src/app/core/services/countries/allowed-phone-numbers.service.spec.ts on lines 6..19
src/app/core/services/gender/gender.service.spec.ts on lines 6..15
src/app/core/services/religion/religion.service.spec.ts on lines 6..17
src/app/pages/academic-year/services/subjects.service.spec.ts on lines 6..15
src/app/pages/admissions/services/studen-details/student-details.service.spec.ts on lines 6..15
src/app/pages/admissions/services/student-id-number/student-id-number.service.spec.ts on lines 6..17
src/app/pages/admissions/services/submit-student-identification.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/class-levels/services/class-level-category.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/class-levels/services/class-level.service.spec.ts on lines 8..19
src/app/pages/curriculum-maintenance/subject-category/services/new-subject-category.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/subject-category/services/subject-category.service.spec.ts on lines 6..17
src/app/pages/curriculum-maintenance/units/services/unit-level.service.spec.ts on lines 6..15
src/app/pages/curriculum-maintenance/units/services/unit.service.spec.ts on lines 6..17
src/app/shared/services/users/users.service.spec.ts on lines 6..15

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

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

  getAll(): Observable<IUnitCategory[]> {
    const url = `${this.config.apiUrl}/api/curriculum/unit-categories`;
    return this.http.get<any>(url).pipe(map(res => {
      return res as unknown;
    })) as Observable<IUnitCategory[]>;
src/app/pages/curriculum-maintenance/subject-category/services/subject-category.service.ts on lines 24..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 86.

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

      }, {
        preIcon: 'perm_identity',
        label: 'Staff Admission',
        // postIcon: 'arrow_right',
        children: [{
Severity: Major
Found in src/app/pages/admissions/services/menu-items.service.ts and 1 other location - About 2 hrs to fix
src/app/pages/admissions/services/menu-items.service.ts on lines 15..39

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

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

      children: [{
        preIcon: 'perm_identity',
        label: 'Student Admission',
        // postIcon: 'arrow_right',
        children: [
Severity: Major
Found in src/app/pages/admissions/services/menu-items.service.ts and 1 other location - About 2 hrs to fix
src/app/pages/admissions/services/menu-items.service.ts on lines 39..60

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

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

  getActive() {
    const url = `${this.config.apiUrl}/api/curriculum/unit-categories/?active=1`;
    return this.http.get<any>(url).pipe(map(res => {
      return res as unknown;
    })) as Observable<IUnitCategory[]>;
src/app/pages/curriculum-maintenance/subject-category/services/subject-category.service.ts on lines 30..35

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

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

StudentGuardianFormComponent has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

@Component({
  selector: 'app-student-guardian-form',
  templateUrl: './student-guardian-form.component.html',
  styleUrls: ['./student-guardian-form.component.css']
})

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

        this.classLevel.getAll({ includeUnits: 1, includeLevels: 1 }).subscribe(items => {
          this.getUnits(items).controls.forEach(element => {
            this.units.push(element);
          });
        });
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 64..70

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

    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

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

        this.classLevel
          .getAll({ includeUnits: 1, includeLevels: 1 })
          .subscribe(items => {
            this.getUnits(items).controls.forEach(element => {
              this.units.push(element);
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 47..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 84.

    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

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

        this.academicYearForm = this.fb.group({
          name: ['', [Validators.required]],
          startDate: ['', [Validators.required]],
          endDate: ['', [Validators.required]],
          units: this.fb.array([])
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 34..39

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

    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

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

        this.academicYearForm = this.fb.group({
          name: ['', [Validators.required]],
          startDate: ['', [Validators.required]],
          endDate: ['', [Validators.required]],
          units: this.fb.array([])
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 54..59

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

    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 intercept has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
            return next.handle(request).pipe(catchError(err => {
                const error = err.statusText || err.error.message;
                if (err.status === 500) {
                    this.message = {
    Severity: Major
    Found in src/app/core/interceptors/error.interceptor.ts - About 2 hrs to fix

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

      describe('MenuItemService', () => {
        beforeEach(() => TestBed.configureTestingModule({}));
      
        it('should be created', () => {
          const service: MenuItemService = TestBed.get(MenuItemService);
      Severity: Major
      Found in src/app/core/menu-item/menu-item.service.spec.ts and 7 other locations - About 2 hrs to fix
      src/app/core/services/http-cache/http-cache.service.spec.ts on lines 5..12
      src/app/core/services/language/language.service.spec.ts on lines 5..12
      src/app/pages/academic-year/services/menu-items.service.spec.ts on lines 5..14
      src/app/pages/admissions/services/menu-items.service.spec.ts on lines 5..12
      src/app/pages/curriculum-maintenance/services/menu-items.service.spec.ts on lines 5..12
      src/app/pages/library/services/menu-items.service.spec.ts on lines 5..12
      src/app/shared/services/message/message.service.spec.ts on lines 5..12

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

      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 8 locations. Consider refactoring.
      Open

      describe('LanguageService', () => {
        beforeEach(() => TestBed.configureTestingModule({}));
      
        it('should be created', () => {
          const service: LanguageService = TestBed.get(LanguageService);
      Severity: Major
      Found in src/app/core/services/language/language.service.spec.ts and 7 other locations - About 2 hrs to fix
      src/app/core/menu-item/menu-item.service.spec.ts on lines 5..12
      src/app/core/services/http-cache/http-cache.service.spec.ts on lines 5..12
      src/app/pages/academic-year/services/menu-items.service.spec.ts on lines 5..14
      src/app/pages/admissions/services/menu-items.service.spec.ts on lines 5..12
      src/app/pages/curriculum-maintenance/services/menu-items.service.spec.ts on lines 5..12
      src/app/pages/library/services/menu-items.service.spec.ts on lines 5..12
      src/app/shared/services/message/message.service.spec.ts on lines 5..12

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

      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 8 locations. Consider refactoring.
      Open

      describe('MenuItemsService', () => {
        beforeEach(() => TestBed.configureTestingModule({}));
      
        it('should be created', () => {
          const service: MenuItemsService = TestBed.get(MenuItemsService);
      Severity: Major
      Found in src/app/pages/library/services/menu-items.service.spec.ts and 7 other locations - About 2 hrs to fix
      src/app/core/menu-item/menu-item.service.spec.ts on lines 5..12
      src/app/core/services/http-cache/http-cache.service.spec.ts on lines 5..12
      src/app/core/services/language/language.service.spec.ts on lines 5..12
      src/app/pages/academic-year/services/menu-items.service.spec.ts on lines 5..14
      src/app/pages/admissions/services/menu-items.service.spec.ts on lines 5..12
      src/app/pages/curriculum-maintenance/services/menu-items.service.spec.ts on lines 5..12
      src/app/shared/services/message/message.service.spec.ts on lines 5..12

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

      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 8 locations. Consider refactoring.
      Open

      describe('MenuItemsService', () => {
        beforeEach(() => TestBed.configureTestingModule({}));
      
        it('should be created', () => {
          const service: AcademicYearMenuItemsService = TestBed.get(
      src/app/core/menu-item/menu-item.service.spec.ts on lines 5..12
      src/app/core/services/http-cache/http-cache.service.spec.ts on lines 5..12
      src/app/core/services/language/language.service.spec.ts on lines 5..12
      src/app/pages/admissions/services/menu-items.service.spec.ts on lines 5..12
      src/app/pages/curriculum-maintenance/services/menu-items.service.spec.ts on lines 5..12
      src/app/pages/library/services/menu-items.service.spec.ts on lines 5..12
      src/app/shared/services/message/message.service.spec.ts on lines 5..12

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

      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