OwenKelvin/Angular-School-Management-System

View on GitHub

Showing 218 of 218 total issues

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

    if (
      this.router.routerState.root &&
      this.router.routerState.root.children &&
      this.router.routerState.root.children[0]
    ) {
src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 42..60
src/app/pages/curriculum-maintenance/class-levels/view-class-level-category/view-class-level-category.component.ts on lines 22..36
src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 42..58
src/app/pages/curriculum-maintenance/subject-category/view-subject-category/view-subject-category.component.ts on lines 22..34
src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 73..113

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

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

    if (
      this.router.routerState.root &&
      this.router.routerState.root.children &&
      this.router.routerState.root.children[0]
    ) {
src/app/pages/academic-year/view-academic-year/view-academic-year.component.ts on lines 30..44
src/app/pages/curriculum-maintenance/class-levels/view-class-level-category/view-class-level-category.component.ts on lines 22..36
src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 42..58
src/app/pages/curriculum-maintenance/subject-category/view-subject-category/view-subject-category.component.ts on lines 22..34
src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 73..113

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

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

        if (this.newForm) {
          this.generateUnitForm();
          this.unitForm.get('name').clearValidators();
          this.unitForm.get('name').updateValueAndValidity();
        } else {
src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 94..111
src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 144..163

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

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

          if (this.newForm) {
            this.generateClassLevelCategoryForm();
            this.classLevelCategoryForm.get('name').clearValidators();
            this.classLevelCategoryForm.get('name').updateValueAndValidity();
          } else {
src/app/pages/curriculum-maintenance/class-levels/create-class-level/create-class-level.component.ts on lines 144..163
src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 252..276

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

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

        if (this.newForm) {
          this.generateClassLevelForm();
          this.classLevelForm.get('name').clearValidators();
          this.classLevelForm.get('name').updateValueAndValidity();
        } else {
src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 94..111
src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 252..276

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

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

    if (
      this.router.routerState.root &&
      this.router.routerState.root.children &&
      this.router.routerState.root.children[0]
    ) {
src/app/pages/academic-year/view-academic-year/view-academic-year.component.ts on lines 30..44
src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 42..60
src/app/pages/curriculum-maintenance/class-levels/view-class-level-category/view-class-level-category.component.ts on lines 22..36
src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 42..58
src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 73..113

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

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

    if (
      this.router.routerState.root &&
      this.router.routerState.root.children &&
      this.router.routerState.root.children[0]
    ) {
src/app/pages/academic-year/view-academic-year/view-academic-year.component.ts on lines 30..44
src/app/pages/curriculum-maintenance/class-levels/create-class-level-category/create-class-level-category.component.ts on lines 42..60
src/app/pages/curriculum-maintenance/class-levels/view-class-level-category/view-class-level-category.component.ts on lines 22..36
src/app/pages/curriculum-maintenance/subject-category/create-subject-category/create-subject-category.component.ts on lines 42..58
src/app/pages/curriculum-maintenance/subject-category/view-subject-category/view-subject-category.component.ts on lines 22..34

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

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

  submit(data: IClassLevel) {
    let url = `${this.config.apiUrl}/api/curriculum/class-levels`;
    if (data.id) {
      url += '/' + data.id;
      return this.http

    Function save has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      save(data) {
        let url = `${this.config.apiUrl}/api/academic-years`;
        if (data.id) {
          url += '/' + data.id;
          return this.http
    Severity: Minor
    Found in src/app/pages/academic-year/services/academic-year.service.ts - About 1 hr to fix

      Function submit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        submit(data: any): Observable<any> {
          const submitData = {
            id: data.id,
            email: data.email,
            first_name: data.firstName,

        Function levenshtein has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          levenshtein(a: string, b: string): number {
            if (a.length === 0) {
              return b.length;
            }
            if (b.length === 0) {
        Severity: Minor
        Found in src/app/core/services/path-resolve/path-resolve.service.ts - About 1 hr to fix

          Function getItems has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getItems(): object {
              const items: object = {
                preIcon: 'date_range',
                label: 'Academic Years',
                postIcon: 'arrow_right',

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

            export class AdmissionsComponent implements OnInit {
            
              constructor() { }
            
              ngOnInit() {
            Severity: Major
            Found in src/app/pages/admissions/admissions.component.ts and 17 other locations - About 1 hr to fix
            src/app/pages/academic-year/academic-year.component.ts on lines 8..15
            src/app/pages/admissions/staff/add-staff/add-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/edit-staff/edit-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/view-staffs/view-staffs.component.ts on lines 8..15
            src/app/pages/admissions/students/edit-student/edit-student.component.ts on lines 8..15
            src/app/pages/admissions/students/students.component.ts on lines 8..15
            src/app/pages/admissions/students/view-student/identification-details/identification-details.component.ts on lines 8..15
            src/app/pages/admissions/students/view-students/view-students.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/class-levels.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/view-class-level/view-class-level.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/curriculum-maintenance.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/subject-category/subject-category.component.ts on lines 8..15
            src/app/pages/home/home.component.ts on lines 8..15
            src/app/pages/library/add-book/add-book.component.ts on lines 8..15
            src/app/pages/library/edit-book/edit-book.component.ts on lines 8..15
            src/app/pages/library/view-books/view-books.component.ts on lines 8..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 55.

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

            export class AddStaffComponent implements OnInit {
            
              constructor() { }
            
              ngOnInit() {
            src/app/pages/academic-year/academic-year.component.ts on lines 8..15
            src/app/pages/admissions/admissions.component.ts on lines 8..15
            src/app/pages/admissions/staff/edit-staff/edit-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/view-staffs/view-staffs.component.ts on lines 8..15
            src/app/pages/admissions/students/edit-student/edit-student.component.ts on lines 8..15
            src/app/pages/admissions/students/students.component.ts on lines 8..15
            src/app/pages/admissions/students/view-student/identification-details/identification-details.component.ts on lines 8..15
            src/app/pages/admissions/students/view-students/view-students.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/class-levels.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/view-class-level/view-class-level.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/curriculum-maintenance.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/subject-category/subject-category.component.ts on lines 8..15
            src/app/pages/home/home.component.ts on lines 8..15
            src/app/pages/library/add-book/add-book.component.ts on lines 8..15
            src/app/pages/library/edit-book/edit-book.component.ts on lines 8..15
            src/app/pages/library/view-books/view-books.component.ts on lines 8..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 55.

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

            export class EditStudentComponent implements OnInit {
            
              constructor() { }
            
              ngOnInit() {
            src/app/pages/academic-year/academic-year.component.ts on lines 8..15
            src/app/pages/admissions/admissions.component.ts on lines 8..15
            src/app/pages/admissions/staff/add-staff/add-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/edit-staff/edit-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/view-staffs/view-staffs.component.ts on lines 8..15
            src/app/pages/admissions/students/students.component.ts on lines 8..15
            src/app/pages/admissions/students/view-student/identification-details/identification-details.component.ts on lines 8..15
            src/app/pages/admissions/students/view-students/view-students.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/class-levels.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/view-class-level/view-class-level.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/curriculum-maintenance.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/subject-category/subject-category.component.ts on lines 8..15
            src/app/pages/home/home.component.ts on lines 8..15
            src/app/pages/library/add-book/add-book.component.ts on lines 8..15
            src/app/pages/library/edit-book/edit-book.component.ts on lines 8..15
            src/app/pages/library/view-books/view-books.component.ts on lines 8..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 55.

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

            export class CurriculumMaintenanceComponent implements OnInit {
            
              constructor() { }
            
              ngOnInit() {
            src/app/pages/academic-year/academic-year.component.ts on lines 8..15
            src/app/pages/admissions/admissions.component.ts on lines 8..15
            src/app/pages/admissions/staff/add-staff/add-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/edit-staff/edit-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/view-staffs/view-staffs.component.ts on lines 8..15
            src/app/pages/admissions/students/edit-student/edit-student.component.ts on lines 8..15
            src/app/pages/admissions/students/students.component.ts on lines 8..15
            src/app/pages/admissions/students/view-student/identification-details/identification-details.component.ts on lines 8..15
            src/app/pages/admissions/students/view-students/view-students.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/class-levels.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/view-class-level/view-class-level.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/subject-category/subject-category.component.ts on lines 8..15
            src/app/pages/home/home.component.ts on lines 8..15
            src/app/pages/library/add-book/add-book.component.ts on lines 8..15
            src/app/pages/library/edit-book/edit-book.component.ts on lines 8..15
            src/app/pages/library/view-books/view-books.component.ts on lines 8..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 55.

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

            export class SubjectCategoryComponent implements OnInit {
            
              constructor() { }
            
              ngOnInit() {
            src/app/pages/academic-year/academic-year.component.ts on lines 8..15
            src/app/pages/admissions/admissions.component.ts on lines 8..15
            src/app/pages/admissions/staff/add-staff/add-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/edit-staff/edit-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/view-staffs/view-staffs.component.ts on lines 8..15
            src/app/pages/admissions/students/edit-student/edit-student.component.ts on lines 8..15
            src/app/pages/admissions/students/students.component.ts on lines 8..15
            src/app/pages/admissions/students/view-student/identification-details/identification-details.component.ts on lines 8..15
            src/app/pages/admissions/students/view-students/view-students.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/class-levels.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/view-class-level/view-class-level.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/curriculum-maintenance.component.ts on lines 8..15
            src/app/pages/home/home.component.ts on lines 8..15
            src/app/pages/library/add-book/add-book.component.ts on lines 8..15
            src/app/pages/library/edit-book/edit-book.component.ts on lines 8..15
            src/app/pages/library/view-books/view-books.component.ts on lines 8..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 55.

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

            export class StaffComponent implements OnInit {
            
              constructor() { }
            
              ngOnInit() {
            Severity: Major
            Found in src/app/pages/admissions/staff/staff.component.ts and 17 other locations - About 1 hr to fix
            src/app/pages/academic-year/academic-year.component.ts on lines 8..15
            src/app/pages/admissions/admissions.component.ts on lines 8..15
            src/app/pages/admissions/staff/add-staff/add-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/edit-staff/edit-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/view-staffs/view-staffs.component.ts on lines 8..15
            src/app/pages/admissions/students/edit-student/edit-student.component.ts on lines 8..15
            src/app/pages/admissions/students/students.component.ts on lines 8..15
            src/app/pages/admissions/students/view-student/identification-details/identification-details.component.ts on lines 8..15
            src/app/pages/admissions/students/view-students/view-students.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/class-levels.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/view-class-level/view-class-level.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/curriculum-maintenance.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/subject-category/subject-category.component.ts on lines 8..15
            src/app/pages/home/home.component.ts on lines 8..15
            src/app/pages/library/add-book/add-book.component.ts on lines 8..15
            src/app/pages/library/edit-book/edit-book.component.ts on lines 8..15
            src/app/pages/library/view-books/view-books.component.ts on lines 8..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 55.

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

            export class ViewStudentsComponent implements OnInit {
            
              constructor() { }
            
              ngOnInit() {
            src/app/pages/academic-year/academic-year.component.ts on lines 8..15
            src/app/pages/admissions/admissions.component.ts on lines 8..15
            src/app/pages/admissions/staff/add-staff/add-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/edit-staff/edit-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/view-staffs/view-staffs.component.ts on lines 8..15
            src/app/pages/admissions/students/edit-student/edit-student.component.ts on lines 8..15
            src/app/pages/admissions/students/students.component.ts on lines 8..15
            src/app/pages/admissions/students/view-student/identification-details/identification-details.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/class-levels.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/view-class-level/view-class-level.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/curriculum-maintenance.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/subject-category/subject-category.component.ts on lines 8..15
            src/app/pages/home/home.component.ts on lines 8..15
            src/app/pages/library/add-book/add-book.component.ts on lines 8..15
            src/app/pages/library/edit-book/edit-book.component.ts on lines 8..15
            src/app/pages/library/view-books/view-books.component.ts on lines 8..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 55.

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

            export class ViewBooksComponent implements OnInit {
            
              constructor() { }
            
              ngOnInit() {
            Severity: Major
            Found in src/app/pages/library/view-books/view-books.component.ts and 17 other locations - About 1 hr to fix
            src/app/pages/academic-year/academic-year.component.ts on lines 8..15
            src/app/pages/admissions/admissions.component.ts on lines 8..15
            src/app/pages/admissions/staff/add-staff/add-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/edit-staff/edit-staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/staff.component.ts on lines 8..15
            src/app/pages/admissions/staff/view-staffs/view-staffs.component.ts on lines 8..15
            src/app/pages/admissions/students/edit-student/edit-student.component.ts on lines 8..15
            src/app/pages/admissions/students/students.component.ts on lines 8..15
            src/app/pages/admissions/students/view-student/identification-details/identification-details.component.ts on lines 8..15
            src/app/pages/admissions/students/view-students/view-students.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/class-levels.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/class-levels/view-class-level/view-class-level.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/curriculum-maintenance.component.ts on lines 8..15
            src/app/pages/curriculum-maintenance/subject-category/subject-category.component.ts on lines 8..15
            src/app/pages/home/home.component.ts on lines 8..15
            src/app/pages/library/add-book/add-book.component.ts on lines 8..15
            src/app/pages/library/edit-book/edit-book.component.ts on lines 8..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 55.

            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