OwenKelvin/Angular-School-Management-System

View on GitHub

Showing 218 of 218 total issues

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

export class HomeComponent implements OnInit {

  constructor() { }

  ngOnInit() {
Severity: Major
Found in src/app/pages/home/home.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/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 EditBookComponent implements OnInit {

  constructor() { }

  ngOnInit() {
Severity: Major
Found in src/app/pages/library/edit-book/edit-book.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/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 AddBookComponent implements OnInit {

  constructor() { }

  ngOnInit() {
Severity: Major
Found in src/app/pages/library/add-book/add-book.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/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 ViewClassLevelComponent 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/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 EditStaffComponent 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/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 StudentsComponent implements OnInit {

  constructor() { }

  ngOnInit() {
Severity: Major
Found in src/app/pages/admissions/students/students.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/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 AcademicYearComponent implements OnInit {

  constructor() { }

  ngOnInit() {
Severity: Major
Found in src/app/pages/academic-year/academic-year.component.ts and 17 other locations - About 1 hr to fix
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
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 4 locations. Consider refactoring.
Open

  it('should have a label with the text content of remember me', () => {
    const compiled = fixture.debugElement.nativeElement;
    expect(
      compiled.querySelector('label[for=remember_me-input]').textContent
    ).toContain('Remember me');
Severity: Major
Found in src/app/login/login.component.spec.ts and 3 other locations - About 1 hr to fix
src/app/login/login.component.spec.ts on lines 39..42
src/app/login/login.component.spec.ts on lines 44..49
src/app/login/login.component.spec.ts on lines 51..56

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 4 locations. Consider refactoring.
Open

  it('should render a heading with the word Login', () => {
    const compiled = fixture.debugElement.nativeElement;
    expect(compiled.querySelector('header').textContent).toContain('Login');
  });
Severity: Major
Found in src/app/login/login.component.spec.ts and 3 other locations - About 1 hr to fix
src/app/login/login.component.spec.ts on lines 44..49
src/app/login/login.component.spec.ts on lines 51..56
src/app/login/login.component.spec.ts on lines 58..63

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 ClassLevelsComponent 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/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 ViewStaffsComponent 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/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 4 locations. Consider refactoring.
Open

  it('should have a label with the text content of username', () => {
    const compiled = fixture.debugElement.nativeElement;
    expect(compiled.querySelector('label[for=username]').textContent).toContain(
      'Username'
    );
Severity: Major
Found in src/app/login/login.component.spec.ts and 3 other locations - About 1 hr to fix
src/app/login/login.component.spec.ts on lines 39..42
src/app/login/login.component.spec.ts on lines 51..56
src/app/login/login.component.spec.ts on lines 58..63

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 4 locations. Consider refactoring.
Open

  it('should have a label with the text content of password', () => {
    const compiled = fixture.debugElement.nativeElement;
    expect(compiled.querySelector('label[for=password]').textContent).toContain(
      'Password'
    );
Severity: Major
Found in src/app/login/login.component.spec.ts and 3 other locations - About 1 hr to fix
src/app/login/login.component.spec.ts on lines 39..42
src/app/login/login.component.spec.ts on lines 44..49
src/app/login/login.component.spec.ts on lines 58..63

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 IdentificationDetailsComponent 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-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 2 locations. Consider refactoring.
Open

      return this.http
        .patch<any>(url, { ...data, unit_category_id: data.unitCategory })
        .pipe(
          map(res => {
            return res;
src/app/pages/curriculum-maintenance/units/services/unit.service.ts on lines 42..48

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

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

      return this.http
        .post<any>(url, { ...data, unit_category_id: data.unitCategory })
        .pipe(
          map(res => {
            return res;
src/app/pages/curriculum-maintenance/units/services/unit.service.ts on lines 34..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 54.

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 ngOnInit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  ngOnInit() {
    this.newForm = true;
    this.errors = {
      name: '',
      abbr: '',

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

        this.unitLevel
          .getFilter({ academicYear: this.parentId })
          .subscribe(items => {
            this.categories = items;
          });
Severity: Major
Found in src/app/core/select/select.component.ts and 3 other locations - About 45 mins to fix
src/app/core/select/select.component.ts on lines 184..186
src/app/pages/curriculum-maintenance/subject-category/view-subject-category/view-subject-category.component.ts on lines 31..33
src/app/pages/curriculum-maintenance/subject-category/view-subject-category/view-subject-category.component.ts on lines 38..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 50.

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

    this.subjectCategory.get({ id: this.id }).subscribe(item => {
      this.currentSubjectCategory = item;
    });
src/app/core/select/select.component.ts on lines 184..186
src/app/core/select/select.component.ts on lines 197..201
src/app/pages/curriculum-maintenance/subject-category/view-subject-category/view-subject-category.component.ts on lines 31..33

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

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

        this.unitLevel
          .getFilter({ academicYear: this.parentId })
          .subscribe(items => { this.categories = items; });
Severity: Major
Found in src/app/core/select/select.component.ts and 3 other locations - About 45 mins to fix
src/app/core/select/select.component.ts on lines 197..201
src/app/pages/curriculum-maintenance/subject-category/view-subject-category/view-subject-category.component.ts on lines 31..33
src/app/pages/curriculum-maintenance/subject-category/view-subject-category/view-subject-category.component.ts on lines 38..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 50.

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