terranodo/angular-search

View on GitHub
app/service/Map.js

Summary

Maintainability
D
2 days
Test Coverage

File Map.js has 537 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*eslint angular/di: [2,"array"]*/
/*eslint angular/document-service: 2*/
/*eslint max-len: [2,100]*/
/**
 * Map service
Severity: Major
Found in app/service/Map.js - About 1 day to fix

    Function buildMapLayers has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                function buildMapLayers(layerConfig) {
                    var layer,
                        layers = [];
    
                    if (angular.isArray(layerConfig)) {
    Severity: Major
    Found in app/service/Map.js - About 2 hrs to fix

      Function createHeatMapSource has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  function createHeatMapSource(hmParams) {
                      var counts_ints2D = hmParams.counts_ints2D,
                          gridLevel = hmParams.gridLevel,
                          gridColumns = hmParams.columns,
                          gridRows = hmParams.rows,
      Severity: Major
      Found in app/service/Map.js - About 2 hrs to fix

        Function init has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    service.init = function(config) {
                        var viewConfig = angular.extend(defaults.view,
                                                            config.mapConfig.view),
                            rendererConfig = config.mapConfig.renderer ?
                                config.mapConfig.renderer : defaults.renderer,
        Severity: Major
        Found in app/service/Map.js - About 2 hrs to fix

          Function getCurrentExtent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      service.getCurrentExtent = function(){
                          var viewProj = service.getMapProjection(),
                              extent = service.getMapView().calculateExtent(service.getMapSize()),
                              extentWgs84 = ol.proj.transformExtent(extent, viewProj, 'EPSG:4326'),
                              transformInteractionLayer = service.
          Severity: Minor
          Found in app/service/Map.js - About 1 hr to fix

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

                        service.createOrUpdateHeatMapLayer = function(hmData) {
                            var existingHeatMapLayers, transformInteractionLayer, olVecSrc, newHeatMapLayer;
            
                            hmData.heatmapRadius = 20;
                            hmData.blur = 6;
            Severity: Minor
            Found in app/service/Map.js - About 1 hr to fix

              Avoid too many return statements within this function.
              Open

                              return scaledValue;
              Severity: Major
              Found in app/service/Map.js - About 30 mins to fix

                There are no issues that match your filters.

                Category
                Status