OwenKelvin/Angular-School-Management-System

View on GitHub

Showing 218 of 218 total issues

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

  submit() {
    if (this.unitForm.valid) {
      this.unit.submit(this.unitForm.value).subscribe(() => {
        this.submitted.emit();
        if (this.newForm) {

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

      beforeEach(async(() => {
        TestBed.configureTestingModule({
          imports: [
            FormsModule,
            CustomMaterialModule,
    src/app/login/login.component.spec.ts on lines 15..27

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

    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

      beforeEach(async(() => {
        TestBed.configureTestingModule({
          imports: [
            RouterTestingModule,
            HttpClientTestingModule,
    Severity: Major
    Found in src/app/login/login.component.spec.ts and 1 other location - About 1 hr to fix
    src/app/pages/admissions/students/student-identification-form/student-identification-form.component.spec.ts on lines 14..27

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

    export function reducer(state, action) {
      const freshState: State = {
        app: {
          user: {
            first_name: '',
    Severity: Minor
    Found in src/app/store/reducers/index.ts - About 1 hr to fix

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

              {
                preIcon: 'directions_bike',
                label: 'Class Levels',
                children: [
                  {
      src/app/pages/academic-year/services/academic-year-menu-items.service.ts on lines 17..34
      src/app/pages/curriculum-maintenance/services/menu-items.service.ts on lines 102..119

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

      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

              {
                preIcon: 'calendar_today',
                label: 'Academic Year Management',
                children: [
                  {
      src/app/pages/curriculum-maintenance/services/menu-items.service.ts on lines 84..101
      src/app/pages/curriculum-maintenance/services/menu-items.service.ts on lines 102..119

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

      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

              {
                preIcon: 'directions_bike',
                label: 'Class Level Categories',
                children: [
                  {
      src/app/pages/academic-year/services/academic-year-menu-items.service.ts on lines 17..34
      src/app/pages/curriculum-maintenance/services/menu-items.service.ts on lines 84..101

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

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

      module.exports = function (config) {
        config.set( {
          browsers: [ 'Chrome', 'ChromeHeadless', 'ChromeHeadlessNoSandbox' ],
          customLaunchers: {
            ChromeHeadlessNoSandbox: {
      Severity: Minor
      Found in karma.conf.js - About 1 hr to fix

        Function login has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          login({ username, password, rememberMe }) {
            const loginData: OauthInterface = {
              grant_type: this.config.grantType,
              client_id: this.config.clientId,
              client_secret: this.config.clientSecret,
        Severity: Minor
        Found in src/app/core/services/authentication/authentication.service.ts - About 1 hr to fix

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

            submit() {
              if (this.classLevelForm.valid) {
                this.classLevel.submit(this.classLevelForm.value).subscribe(() => {
                  this.submitted.emit(true);
                  if (this.newForm) {

            Function levenshtein has a Cognitive Complexity of 11 (exceeds 5 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

            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

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

                      this.unit
                        .get({ id, includeUnitLevels: 1, includeClassLevels: 1 })
                        .pipe(
                          map(res => {
                            return {
            src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 257..272

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

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

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

                      this.unit
                        .get({
                          id: this.formId,
                          includeUnitLevels: 1,
                          includeClassLevels: 1
            src/app/pages/curriculum-maintenance/units/create-unit/create-unit.component.ts on lines 93..104

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

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

              ngOnChanges(changes: SimpleChanges) {
                if (changes.submit.currentValue && changes.submit && !changes.submit.firstChange) {
                  if (this.userIdentificaionForm.valid) {
                    this.submitted.emit(true);
                    this.formSubmit.submit({ ...this.serverStudentData, ...this.userIdentificaionForm.value }, this.idNumber).subscribe(

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

                submit() {
                  if (this.classLevelCategoryForm.valid) {
                    this.classLevelCategory
                      .submit(this.classLevelCategoryForm.value)
                      .subscribe(() => {

                Function reducer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function reducer(state, action) {
                
                  const admissions = state ? state.admissions : {};
                  switch (action.type) {
                    case SET_STUDENT_ID_NUMBER:
                Severity: Minor
                Found in src/app/pages/admissions/store/reducers/index.ts - About 1 hr to fix

                  Function get has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    get(key: string): IMessage {
                      switch (key) {
                        case 'ERROR':
                          return {
                            type: 'error',
                  Severity: Minor
                  Found in src/app/shared/services/message/message.service.ts - About 1 hr to fix

                    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/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/create-class-level-category/create-class-level-category.component.ts on lines 42..60
                    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

                    Severity
                    Category
                    Status
                    Source
                    Language