terranodo/angular-search

View on GitHub

Showing 27 of 27 total issues

Function timeHistogram has 228 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function timeHistogram($rootScope, HeatMapSourceGenerator,
            searchFilter, DateTimeService, NumberService) {
            var directive = {
                templateUrl: 'components/histogram/histogram.tpl.html',
                restrict: 'EA',
Severity: Major
Found in app/components/histogram/HistogramDirective.js - About 1 day to fix

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

                  function link(scope, element, attr) {
                      var HistogramBars;
                      var vm = scope;
      
                      vm.barId = attr.barid;
      Severity: Major
      Found in app/components/histogram/HistogramDirective.js - About 1 day to fix

        Function exports has 121 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(grunt) {
        
            grunt.loadNpmTasks('grunt-contrib-clean');
            grunt.loadNpmTasks('grunt-gh-pages');
            grunt.loadNpmTasks('grunt-contrib-watch');
        Severity: Major
        Found in Gruntfile.js - About 4 hrs to fix

          Function keywordInput has 116 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function keywordInput(HeatMapSourceGenerator, searchFilter, $window, filterKeywordService) {
          
                      return {
                          link: keywordInputLink,
                          restrict: 'EA',
          Severity: Major
          Found in app/components/keywordInput/keywordInputDirective.js - About 4 hrs to fix

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

                        function keywordInputLink(scope) {
                            var vm = scope;
                            var numberKeywords = vm.numberKeywords || 5;
            
                            vm.filter = searchFilter;
            Severity: Major
            Found in app/components/keywordInput/keywordInputDirective.js - About 4 hrs to fix

              Function datePickerFilterLink has 80 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          function datePickerFilterLink(scope) {
              
                              var vm = scope;
              
                              vm.dateOptions = searchFilter;
              Severity: Major
              Found in app/components/datepicker/DatepickerDirective.js - About 3 hrs 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 makeHistogram has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                      function makeHistogram(histogram) {
                      
                                          var barsheight = 54;
                                          var histogrambarsWidth = 350;
                                          var paddingBar = 8;
                      Severity: Minor
                      Found in app/components/histogram/HistogramDirective.js - About 2 hrs to fix

                        Function tweetlist has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function tweetlist(Map, HeightModule, PanelInformationService) {
                                    var MapService = Map;
                                    return {
                                        link: tweetlistLink,
                                        restrict: 'EA',
                        Severity: Minor
                        Found in app/components/tweetlist/tweetlistDirective.js - About 1 hr to fix

                          Function exports has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function ( config ) {
                            config.set({
                              basePath: '.',
                              files: [
                                'assets/lib/angular/angular.min.js',
                          Severity: Minor
                          Found in karma.conf.js - About 1 hr to fix

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

                                            function openStartDate() {
                                                vm.startDate.opened = true;
                                                vm.dateOptions.minDate = vm.initialDateOptions.minDate;
                                                vm.dateOptions.maxDate = vm.datepickerEndDate;
                                            }
                            Severity: Major
                            Found in app/components/datepicker/DatepickerDirective.js and 1 other location - About 1 hr to fix
                            app/components/datepicker/DatepickerDirective.js on lines 83..87

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

                            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

                                            function openEndDate() {
                                                vm.endDate.opened = true;
                                                vm.dateOptions.maxDate = vm.initialDateOptions.maxDate;
                                                vm.dateOptions.minDate = vm.datepickerStartDate;
                                            }
                            Severity: Major
                            Found in app/components/datepicker/DatepickerDirective.js and 1 other location - About 1 hr to fix
                            app/components/datepicker/DatepickerDirective.js on lines 70..74

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

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

                                    function compactInteger(input, decimals) {
                                        decimals = decimals || 0;
                                        decimals = Math.max(decimals, 0);
                                        var number = parseInt(input, 10);
                                        var signString = number < 0 ? '-' : '';
                            Severity: Minor
                            Found in app/service/numberService.js - About 1 hr to fix

                              Function tweetlistLink has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          function tweetlistLink(scope) {
                                              var vm = scope;
                                              vm.tweetList = [];
                                              vm.tweetList.exist = false;
                              
                              
                              Severity: Minor
                              Found in app/components/tweetlist/tweetlistDirective.js - About 1 hr to fix

                                Function modalLink has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            function modalLink(scope) {
                                                var vm = scope;
                                                var MapService = Map;
                                                vm.closestTweets = [];
                                                vm.coordinate = [];
                                Severity: Minor
                                Found in app/components/modalTweets/modalTweetsDirective.js - About 1 hr to fix

                                  Function setupEvents has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              vm.setupEvents = function() {
                                                  MapService.getMap().getView().on('change:center', function(evt){
                                                      mapIsMoved = !mapIsMoved ? true : false;
                                                  });
                                                  MapService.getMap().getView()
                                  Severity: Minor
                                  Found in app/controller/Main.js - About 1 hr 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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language