OwenKelvin/Angular-School-Management-System

View on GitHub

Showing 218 of 218 total issues

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

      case 'units':
        this.label = 'Unit';
        this.error.required = 'The unit field is required';
        this.hint = 'Please select a unit';
        this.subjectCategoriesService.getAll().subscribe(items => {
Severity: Major
Found in src/app/core/select/select.component.ts and 1 other location - About 5 hrs to fix
src/app/core/select/select.component.ts on lines 154..166

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

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

    if (
      this.router.routerState.root &&
      this.router.routerState.root.children &&
      this.router.routerState.root.children[0] &&
      this.router.routerState.root.children[0].children &&
src/app/pages/curriculum-maintenance/class-levels/view-class-level-category/view-class-level-category.component.ts on lines 22..36

Duplicated Code

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

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

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

Tuning

This issue has a mass of 137.

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 student-guardian-form.component.ts has 376 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormGroup, Validators, FormBuilder, FormControl, FormArray } from '@angular/forms';
import { IdNumberValidator } from '../validators/student-id-taken.validator';
import { SET_STUDENT_ID_NUMBER } from '../../store/actions/pages.actions';
import { Store, select } from '@ngrx/store';

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

      validateDateOfBirth() {
        if ((this.userIdentificaionForm.get('dateOfBirth').dirty || this.userIdentificaionForm.get('dateOfBirth').touched) &&
          !this.userIdentificaionForm.get('dateOfBirth').valid) {
          if (this.userIdentificaionForm.get('dateOfBirth').errors.required) {
            this.errors.dateOfBirth = 'Date Of Birth is required';
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

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

      validateName() {
        if (
          (this.unitForm.get('name').dirty || this.unitForm.get('name').touched) &&
          !this.unitForm.get('name').valid
        ) {
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

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

      validateStartDate() {
        if (
          (this.academicYearForm.get('startDate').dirty ||
            this.academicYearForm.get('startDate').touched) &&
          !this.academicYearForm.get('startDate').valid
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

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

      validateName() {
        if (
          (this.academicYearForm.get('name').dirty ||
            this.academicYearForm.get('name').touched) &&
          !this.academicYearForm.get('name').valid
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

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

      validateEndDate() {
        if (
          (this.academicYearForm.get('endDate').dirty ||
            this.academicYearForm.get('endDate').touched) &&
          !this.academicYearForm.get('endDate').valid
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

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

      validateName() {
        if (
          (this.classLevelForm.get('name').dirty ||
            this.classLevelForm.get('name').touched) &&
          !this.classLevelForm.get('name').valid
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

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

      validateName() {
        if (
          (this.newSubjectCategoryForm.get('name').dirty ||
            this.newSubjectCategoryForm.get('name').touched) &&
          !this.newSubjectCategoryForm.get('name').valid
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

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

      validateUnitCategory() {
        if (
          (this.unitForm.get('unitCategory').dirty ||
            this.unitForm.get('unitCategory').touched) &&
          !this.unitForm.get('unitCategory').valid
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

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

      validateAbbr() {
        if (
          (this.unitForm.get('abbr').dirty || this.unitForm.get('abbr').touched) &&
          !this.unitForm.get('abbr').valid
        ) {
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195

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

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

      validateName() {
        if (
          (this.classLevelCategoryForm.get('name').dirty ||
            this.classLevelCategoryForm.get('name').touched) &&
          !this.classLevelCategoryForm.get('name').valid
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

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

      validateAbbr() {
        if (
          (this.classLevelForm.get('abbr').dirty ||
            this.classLevelForm.get('abbr').touched) &&
          !this.classLevelForm.get('abbr').valid
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-academic-year-allocation/student-academic-year-allocation.component.ts on lines 23..35
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

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

      validateAcademicYear() {
        if (
          (this.academicsDetailsForm.get('academicYear').dirty ||
            this.academicsDetailsForm.get('academicYear').touched) &&
          !this.academicsDetailsForm.get('academicYear').valid
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 87..99
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 100..112
    src/app/pages/academic-year/create-academic-year/create-academic-year.component.ts on lines 113..125
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.ts on lines 215..224
    src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 113..125
    src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 127..139
    src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 75..87
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 171..182
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 183..195
    src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 203..214

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

    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 routes: Routes = [
      {
        path: 'admissions',
        component: PagesComponent,
        children: [{
    Severity: Major
    Found in src/app/pages/admissions/students/students-routing.module.ts and 1 other location - About 4 hrs to fix
    src/app/pages/admissions/staff/staff-routing.module.ts on lines 9..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 130.

    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 routes: Routes = [
      {
        path: 'admissions',
        component: PagesComponent,
        children: [{
    Severity: Major
    Found in src/app/pages/admissions/staff/staff-routing.module.ts and 1 other location - About 4 hrs to fix
    src/app/pages/admissions/students/students-routing.module.ts on lines 10..40

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

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

      getItems(): object {
        const items: object = {
          preIcon: 'local_library',
          label: 'Library',
          postIcon: 'arrow_right',
    Severity: Major
    Found in src/app/pages/library/services/menu-items.service.ts - About 3 hrs to fix

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

        get(data: { id: number, classLevel?: 0 | 1}) {
          const { id, classLevel } = data;
          let url = `${this.config.apiUrl}/api/curriculum/class-level-categories/${id}`;
          if (classLevel === 1) {
            url += '/?class_level=1';
      src/app/pages/academic-year/services/academic-year.service.ts on lines 32..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 108.

      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

        get(data: { id: number; classLevels: 1 }) {
          const { id, classLevels } = data;
          let url = `${this.config.apiUrl}/api/academic-years/${id}/?`;
          if (classLevels === 1) {
            url += 'class_levels=1';
      src/app/pages/curriculum-maintenance/class-levels/services/class-level-category.service.ts on lines 21..32

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

      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