Vizzuality/gfw-climate

View on GitHub
app/assets/javascripts/map/views/tabs/AnalysisView.js

Summary

Maintainability
F
1 wk
Test Coverage

File AnalysisView.js has 576 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * The AnalysisView selector view.
 *
 * @return AnalysisView instance (extends Backbone.View).
 */
Severity: Major
Found in app/assets/javascripts/map/views/tabs/AnalysisView.js - About 1 day to fix

    Function drawMaskArea has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          drawMaskArea: function(geojson, iso, region) {
            this.mask = cartodb.createLayer(this.map, {
              user_name: 'wri-01',
              type: 'cartodb',
              cartodb_logo: false,
    Severity: Major
    Found in app/assets/javascripts/map/views/tabs/AnalysisView.js - About 2 hrs to fix

      Function drawMaskCountry has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            drawMaskCountry: function(geojson, iso) {
              this.mask = cartodb.createLayer(this.map, {
                user_name: 'wri-01',
                type: 'cartodb',
                cartodb_logo: false,
      Severity: Minor
      Found in app/assets/javascripts/map/views/tabs/AnalysisView.js - About 1 hr to fix

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

              toggleTabs: function(e) {
                if (!$(e.currentTarget).hasClass('disabled')) {
                  var tab = $(e.currentTarget).data('analysis');
        
                  // Current tab
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 1 day to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 114..143

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

        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

              setSelects: function(iso, dont_analyze) {
                this.iso = iso.country;
                this.area = iso.region;
        
                this.$countrySelect.val(this.iso).trigger('chosen:updated');
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 6 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 307..324

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

        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

              changeIso: function(e) {
                this.iso = $(e.currentTarget).val();
                this.$countryButton.removeClass('disabled');
                this.area = null;
                if (this.iso) {
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 5 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 286..300

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

        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 2 locations. Consider refactoring.
        Open

              openTab: function(type) {
                var current;
                switch (type) {
                  case 'geojson':
                    current = '#draw-tab-button';
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 5 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 145..168

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

        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

              _onClickAnalysis: function() {
                if (!this.$start.hasClass('in_use')) {
                  ga('send', 'event', 'Map', 'Analysis', 'Click: start');
                  this.toggleUseBtn(true);
                  this._startDrawingManager();
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 4 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 347..358

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

        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 2 locations. Consider refactoring.
        Open

              toggleUseBtn: function(to) {
                this.$start.toggleClass('in_use', to);
                to
                  ? this.$start
                      .removeClass('blue')
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 3 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 503..515

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

        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 2 locations. Consider refactoring.
        Open

              onGifPlay: function() {
                this.$play.addClass('hidden');
                this.$img.attr('src', this.gif);
                setTimeout(
                  _.bind(function() {
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 3 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 523..533

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

        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 2 locations. Consider refactoring.
        Open

              _resetDrawing: function() {
                this.model.set('is_drawing', false);
                if (this.$infowindows) this.$infowindows.hide(0).removeClass('hidden');
                if (this.drawingManager) {
                  this.drawingManager.setDrawingMode(null);
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 3 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 427..434

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

        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 2 locations. Consider refactoring.
        Open

                this.drawingManager = new google.maps.drawing.DrawingManager({
                  drawingControl: false,
                  drawingMode: google.maps.drawing.OverlayType.POLYGON,
                  polygonOptions: _.extend(
                    {
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 380..391

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

        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 2 locations. Consider refactoring.
        Open

              drawPaths: function(paths) {
                var overlay = new google.maps.Polygon(
                  _.extend({}, { paths: paths }, this.style)
                );
        
        
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 463..470

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

        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 2 locations. Consider refactoring.
        Open

                  if (to) {
                    this.$button.hasClass('active')
                      ? this.$button.trigger('click')
                      : null;
                    this.$button.removeClass('in_use').addClass('disabled');
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 492..499

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

        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 2 locations. Consider refactoring.
        Open

              drawCountrypolygon: function(geojson, color) {
                var geojson = this.setGeojson(geojson, color);
                this.setStyle();
                var multipolygon = this.map.data.addGeoJson(geojson)[0];
                this.presenter.setMultipolygon(multipolygon, geojson);
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 481..486

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

        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 6 locations. Consider refactoring.
        Open

                enquire.register(
                  'screen and (min-width:' + window.gfw.config.GFW_MOBILE + 'px)',
                  {
                    match: _.bind(function() {
                      this.mobile = false;
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 5 other locations - About 1 hr to fix
        app/assets/javascripts/compare/views/index/CompareGridView.js on lines 25..33
        app/assets/javascripts/compare/views/index/CompareGridView.js on lines 35..43
        app/assets/javascripts/map/views/tabs/CountriesView.js on lines 76..84
        app/assets/javascripts/map/views/tabs/CountriesView.js on lines 85..93
        app/assets/javascripts/widgets/views/WidgetView.js on lines 40..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 73.

        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

              inits: function() {
                // countries
                this.setStyle();
                this.getCountries();
        
        
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 103..111

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

        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 2 locations. Consider refactoring.
        Open

              _onOverlayComplete: function(e) {
                ga('send', 'event', 'Map', 'Analysis', 'Polygon: complete');
                this.presenter.onOverlayComplete(e);
                this._resetDrawing();
                // buttons clases
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 408..414

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

        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 2 locations. Consider refactoring.
        Open

              _stopDrawing: function() {
                this.presenter.stopDrawing();
                this._resetDrawing();
                // buttons clases
                this.toggleUseBtn(false);
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 419..425

        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

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

              changeArea: function(e) {
                this.area = $(e.currentTarget).val();
                this.$countryButton.removeClass('disabled');
              },
        Severity: Minor
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 50 mins to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 301..304

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

        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 4 locations. Consider refactoring.
        Open

              renderMobile: function() {
                this.$el.html(this.templateMobile());
                this.cacheVars();
                this.inits();
              },
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 3 other locations - About 50 mins to fix
        app/assets/javascripts/map/views/tabs/AnalysisView.js on lines 120..124
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 97..101
        app/assets/javascripts/widgets/indicators/multiline/MultiLineChartIndicator.js on lines 101..105

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

        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 4 locations. Consider refactoring.
        Open

              render: function() {
                this.$el.html(this.template());
                this.cacheVars();
                this.inits();
              },
        Severity: Major
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 3 other locations - About 50 mins to fix
        app/assets/javascripts/map/views/tabs/AnalysisView.js on lines 126..130
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 97..101
        app/assets/javascripts/widgets/indicators/multiline/MultiLineChartIndicator.js on lines 101..105

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

        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 2 locations. Consider refactoring.
        Open

              toggleDoneBtn: function(to) {
                $('#draw-analysis').toggleClass('one', to);
                this.$done.parent().toggleClass('hidden', to);
              },
        Severity: Minor
        Found in app/assets/javascripts/map/views/tabs/AnalysisView.js and 1 other location - About 45 mins to fix
        app/assets/javascripts/map/views/tabs/SubscriptionView.js on lines 517..520

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

        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

        There are no issues that match your filters.

        Category
        Status