Vizzuality/gfw-climate

View on GitHub

Showing 1,213 of 1,213 total issues

Function View/update has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          'View/update': function(view) {
            var p = {
              view: view
            };

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

        LineChart.prototype._drawAxes = function(group) {
          var self = this;
          var tickFormatY = this.unit != 'percentage' ? 's' : '.2f';
          this.xAxis = d3.svg
            .axis()
    Severity: Minor
    Found in app/assets/javascripts/widgets/indicators/line/LineChart.js - About 1 hr to fix

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

          LineChart.prototype._drawAverages = function() {
            var self = this;
            var averages = _.map(self.data, function(d, i) {
              var txtaverage;
              var average =

        Method emission_factors_from has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def emission_factors_from data
            response = {}
        
            total = 0
            val = data.select do |t|
        Severity: Minor
        Found in app/models/country_report.rb - About 1 hr to fix

          Function toggleLayersGroup has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                toggleLayersGroup: function(e) {
                  if (
                    !$(e.target).hasClass('source') &&
                    !$(e.target)
                      .parent()
          Severity: Minor
          Found in app/assets/javascripts/map/views/LayersNavView.js - About 1 hr to fix

            Function initialize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  initialize: function(map) {
                    _.bindAll(
                      this,
                      'zoomIn',
                      'zoomOut',
            Severity: Minor
            Found in app/assets/javascripts/map/views/MapControlsView.js - About 1 hr to fix

              Function _handleNewLayers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _handleNewLayers: function(baselayers, date) {
                    var date;
                    var currentTimeline = this.status.get('timeline');
                    var baselayer = _.values(
                      _.omit(baselayers, [
              Severity: Minor
              Found in app/assets/javascripts/map/presenters/TimelinePresenter.js - About 1 hr to fix

                Function _drawHandle has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      _drawHandle: function() {
                        this.handleContainer = this.svg.append('g');
                
                        this.handle = this.handleContainer
                          .append('rect')

                  Function LineChart has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var LineChart = function(options) {
                        this.svg;
                        this.options = options;
                        this.parent = options.parent;
                        this.data = options.data;

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

                          changeWidgets: function(e) {
                            this.presenter.changeActiveWidgets(
                              $(e.currentTarget).data('id'),
                              $(e.currentTarget).hasClass('is-active')
                            );
                    app/assets/javascripts/compare/views/index/CompareWidgetsModalView.js on lines 93..98
                    app/assets/javascripts/countries/views/show/CountryWidgetsModalView.js on lines 173..178
                    app/assets/javascripts/countries/views/show/CountryWidgetsModalView.js on lines 180..185

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

                    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.status.set({
                                    country: params.country.iso,
                                    view: params.view,
                                    areas: null,
                                    jurisdictions: null,
                    app/assets/javascripts/countries/presenters/show/WidgetGridPresenter.js on lines 175..182

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

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

                          getData: function(type) {
                            var parseDate = d3.time.format('%Y').parse;
                            return _.map(
                              this.model.get(type),
                              _.bind(function(indicator_values) {

                      Function keyup_checker has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              (AbstractChosen.prototype.keyup_checker = function(a) {
                                var b, c;
                                switch (((b = null != (c = a.which) ? c : a.keyCode),
                                this.search_field_scale(),
                                b)) {
                      Severity: Minor
                      Found in app/assets/javascripts/chosen.jquery.min.js - About 1 hr to fix

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

                              changeAreas: function(e) {
                                this.presenter.changeActiveAreas(
                                  $(e.currentTarget).data('id'),
                                  $(e.currentTarget).hasClass('is-active')
                                );
                        app/assets/javascripts/compare/views/index/CompareWidgetsModalView.js on lines 93..98
                        app/assets/javascripts/countries/views/show/CountryWidgetsModalView.js on lines 166..171
                        app/assets/javascripts/countries/views/show/CountryWidgetsModalView.js on lines 173..178

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

                        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

                              changeJurisdictions: function(e) {
                                this.presenter.changeActiveJurisdictions(
                                  $(e.currentTarget).data('id'),
                                  $(e.currentTarget).hasClass('is-active')
                                );
                        app/assets/javascripts/compare/views/index/CompareWidgetsModalView.js on lines 93..98
                        app/assets/javascripts/countries/views/show/CountryWidgetsModalView.js on lines 166..171
                        app/assets/javascripts/countries/views/show/CountryWidgetsModalView.js on lines 180..185

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

                        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

                              changeEndDate: function(e) {
                                var endYear = $(e.currentTarget).val();
                                ga('send', 'event', 'Widget', 'End year', endYear);
                                this.presenter.changeEndDate(endYear);
                              },
                        Severity: Major
                        Found in app/assets/javascripts/widgets/views/TabView.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/widgets/views/TabView.js on lines 93..97

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

                        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

                                  linesGroup
                                    .append('rect')
                                    .attr('class', 'xAxis')
                                    .attr('width', this.cWidth)
                                    .attr('height', 1)
                        app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 643..649

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

                        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

                                grid
                                  .append('rect')
                                  .attr('class', 'xAxis')
                                  .attr('width', this.cWidth)
                                  .attr('height', 1)
                        app/assets/javascripts/countries/views/report/HistoricalTrendChartView.js on lines 305..311

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

                        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

                              render: function() {
                                this.$el.html(this.template());
                                this.totalSteps = this.$('.carbon-forest-section.step').length - 1;
                              }
                        app/assets/javascripts/insights/views/carbon-cycle/CarbonCycleView.js on lines 55..58

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

                        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

                                  date[1] =
                                    date[1] != null
                                      ? !!date[1]._isAMomentObject ? date[1] : date[1].substr(0, 10)
                                      : '2014-12-31';
                        app/assets/javascripts/map/presenters/tabs/AnalysisPresenter.js on lines 596..599

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

                        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