540co/epa-rfi

View on GitHub

Showing 38 of 38 total issues

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

      it('should filter the report by state', function() {
        vm.searchFilter = {
          state: 'TX'
        };

Severity: Major
Found in src/app/dashboard/dashboard.controller.spec.js and 1 other location - About 1 day to fix
src/app/dashboard/dashboard.controller.spec.js on lines 138..159

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

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

      it('should filter the report by zipcode', function() {
        vm.searchFilter = {
          zipcode: '20002'
        };

Severity: Major
Found in src/app/dashboard/dashboard.controller.spec.js and 1 other location - About 1 day to fix
src/app/dashboard/dashboard.controller.spec.js on lines 115..136

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

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

    it('should add end year to query params', function() {
      var expectedPoundsQueryParams = {
          'filters': 'year:[* TO 2009] AND unitOfMeasure:Pounds',
          'groupBy': 'year',
          'operation': 'sum',
Severity: Major
Found in src/app/services/reports.service.spec.js and 1 other location - About 1 day to fix
src/app/services/reports.service.spec.js on lines 222..250

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

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

    it('should add start year to query params', function() {
      var expectedPoundsQueryParams = {
          'filters': 'year:[2005 TO *] AND unitOfMeasure:Pounds',
          'groupBy': 'year',
          'operation': 'sum',
Severity: Major
Found in src/app/services/reports.service.spec.js and 1 other location - About 1 day to fix
src/app/services/reports.service.spec.js on lines 252..280

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

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

  function ReportService(DataService, $q) {

    var reportService = {
      getYearlyAirPollutionReport: getYearlyAirPollutionReport,
      getStateList: getStateList
Severity: Major
Found in src/app/services/reports.service.js - About 5 hrs to fix

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

          it('should load facilities in the given zipcode', function() {
            $location.search = function() {
              return {
                zipcode: '20607'
              };
    Severity: Major
    Found in src/app/facility/facilityList.controller.spec.js and 1 other location - About 4 hrs to fix
    src/app/facility/facilityList.controller.spec.js on lines 110..129

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

    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

          it('should load facilities in the given state', function() {
            $location.search = function() {
              return {
                state: 'TX'
              };
    Severity: Major
    Found in src/app/facility/facilityList.controller.spec.js and 1 other location - About 4 hrs to fix
    src/app/facility/facilityList.controller.spec.js on lines 89..108

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    File reports.service.spec.js has 343 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function() {
      'use strict';
    
      describe('ReportService', function() {
        var ReportService,
    Severity: Minor
    Found in src/app/services/reports.service.spec.js - About 4 hrs to fix

      Function DashboardController has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function DashboardController(ReportService, $log, logger) {
          var vm = this;
      
          activate();
      
      
      Severity: Major
      Found in src/app/dashboard/dashboard.controller.js - About 4 hrs to fix

        Function FacilityListController has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function FacilityListController(DataService, $location, NgMap, $google, $timeout) {
            var vm = this,
              params = $location.search(),
              google = $google;
        
        
        Severity: Major
        Found in src/app/facility/facilityList.controller.js - About 2 hrs to fix

          File dashboard.controller.spec.js has 258 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          (function() {
            'use strict';
          
            describe('epaApp', function() {
              var scope,
          Severity: Minor
          Found in src/app/dashboard/dashboard.controller.spec.js - About 2 hrs to fix

            Function FacilityController has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function FacilityController(DataService, $stateParams, logger, NgMap, $google, $timeout) {
                var vm = this;
            
                activate();
            
            
            Severity: Major
            Found in src/app/facility/facility.controller.js - About 2 hrs to fix

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

                    it('should clear the zip code filter', function() {
                      vm.searchFilter = {
                        zipcode: '20002',
                        group: 'zipcode'
                      };
              Severity: Major
              Found in src/app/dashboard/dashboard.controller.spec.js and 1 other location - About 2 hrs to fix
              src/app/dashboard/dashboard.controller.spec.js on lines 186..198

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

              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

                    it('should clear the state filter', function() {
                      vm.searchFilter = {
                        state: 'TX',
                        group: 'state'
                      };
              Severity: Major
              Found in src/app/dashboard/dashboard.controller.spec.js and 1 other location - About 2 hrs to fix
              src/app/dashboard/dashboard.controller.spec.js on lines 200..212

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

              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

                      expect(DataService.Facilities.query.calls.argsFor(0)).toEqual([{
                        limit: 25,
                        offset: 0,
                        filters: 'facility.address.zipcode:20607'
                      }, jasmine.any(Function), jasmine.any(Function)]);
              Severity: Major
              Found in src/app/facility/facilityList.controller.spec.js and 1 other location - About 1 hr to fix
              src/app/facility/facilityList.controller.spec.js on lines 157..161

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

              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

                      expect(DataService.Facilities.query.calls.argsFor(1)).toEqual([{
                        limit: 100,
                        offset: 100,
                        filters: 'facility.address.zipcode:20607'
                      }, jasmine.any(Function), jasmine.any(Function)]);
              Severity: Major
              Found in src/app/facility/facilityList.controller.spec.js and 1 other location - About 1 hr to fix
              src/app/facility/facilityList.controller.spec.js on lines 145..149

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

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

              module.exports = function(config) {
              
                var configuration = {
                  files: listFiles(),
              
              
              Severity: Minor
              Found in karma.conf.js - About 1 hr to fix

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

                    function calculateReportTotals(reportData) {
                      // Total years
                      var numReportRows = reportData.length;
                      if(numReportRows > 0) {
                      // Add totals to reports
                Severity: Minor
                Found in src/app/services/reports.service.js - About 1 hr to fix

                  Function buildQueryParams has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function buildQueryParams(params, unitOfMeasure) {
                        var filters = [],
                          queryParams = {},
                          filterMappings = {
                            'state': 'facility.address.state',
                  Severity: Minor
                  Found in src/app/services/reports.service.js - About 1 hr to fix

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

                        function DataService($resource, TRI_API_ENDPOINT) {
                          var service = {
                            Facilities: $resource(
                              TRI_API_ENDPOINT + '/facilities/:id',
                              {id: '@id'},
                    Severity: Minor
                    Found in src/app/services/data.service.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language