eHealthAfrica/direct-delivery-dashboard

View on GitHub

Showing 318 of 318 total issues

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

      return $q.all(promises)
        .then(function (res) {
          return _this.collateReport(res[0], deliveryRounds, res[1])
        })
Severity: Minor
Found in src/app/reports/reports.service.js and 1 other location - About 35 mins to fix
src/app/reports/reports.service.js on lines 227..230

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

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 gulp.src([
    path.join(conf.paths.src, '/app/**/*.html'),
    path.join(conf.paths.tmp, '/serve/app/**/*.html')
  ])
Severity: Minor
Found in gulp/build.js and 1 other location - About 35 mins to fix
gulp/build.js on lines 94..94

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

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

Avoid too many return statements within this function.
Open

        return lightOrange
Severity: Major
Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return 'A_week_late'
    Severity: Major
    Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return 'More_than_a_week_late'
      Severity: Major
      Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return darkOrange
        Severity: Major
        Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return black // unknown or unexpected status
          Severity: Major
          Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return orange
            Severity: Major
            Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return darkRed
              Severity: Major
              Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return red
                Severity: Major
                Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return lightRed
                  Severity: Major
                  Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return 'A_day_late'
                    Severity: Major
                    Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

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

                                facility.ward = locationLevel.ward[ancestors[0]] ? locationLevel.ward[ancestors[0]].name : ''
                      Severity: Minor
                      Found in src/app/facility/facility.service.js and 2 other locations - About 30 mins to fix
                      src/app/facility/facility.service.js on lines 119..119
                      src/app/facility/facility.service.js on lines 120..120

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

                      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

                                facility.lga = locationLevel.lga[ancestors[1]] ? locationLevel.lga[ancestors[1]].name : ''
                      Severity: Minor
                      Found in src/app/facility/facility.service.js and 2 other locations - About 30 mins to fix
                      src/app/facility/facility.service.js on lines 119..119
                      src/app/facility/facility.service.js on lines 121..121

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

                      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 (type === 'prev' && vm.hasPrev()) {
                              vm.pagination.page--
                              vm.getReport()
                            }
                      Severity: Minor
                      Found in src/app/reports/invoice/invoice.controller.js and 2 other locations - About 30 mins to fix
                      src/app/reports/invoice/invoice.controller.js on lines 40..43
                      src/app/reports/invoice/round/round.controller.js on lines 107..110

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

                      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

                                facility.zone = locationLevel.zone[ancestors[2]] ? locationLevel.zone[ancestors[2]].name : ''
                      Severity: Minor
                      Found in src/app/facility/facility.service.js and 2 other locations - About 30 mins to fix
                      src/app/facility/facility.service.js on lines 120..120
                      src/app/facility/facility.service.js on lines 121..121

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

                      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 (type === 'next' && vm.hasNext()) {
                              vm.pagination.page++
                              vm.getReport()
                            }
                      Severity: Minor
                      Found in src/app/reports/invoice/invoice.controller.js and 2 other locations - About 30 mins to fix
                      src/app/reports/invoice/invoice.controller.js on lines 45..48
                      src/app/reports/invoice/round/round.controller.js on lines 107..110

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

                      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

                            } else if (type === 'prev' && vm.hasPrev()) {
                              vm.pagination.page--
                              vm.getReport()
                            }
                      Severity: Minor
                      Found in src/app/reports/invoice/round/round.controller.js and 2 other locations - About 30 mins to fix
                      src/app/reports/invoice/invoice.controller.js on lines 40..43
                      src/app/reports/invoice/invoice.controller.js on lines 45..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 45.

                      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