livingsocial/rearview-engine

View on GitHub

Showing 133 of 133 total issues

File expandedmonitor.js has 573 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define([
    'view/base',
    'view/deletemonitor',
    'model/monitor',
    'util/cron',
Severity: Major
Found in public/rearview-src/js/view/expandedmonitor.js - About 1 day to fix

    File addmonitor.js has 553 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    define([
        'view/base',
        'model/monitor',
        'codemirror',
        'util/cron',
    Severity: Major
    Found in public/rearview-src/js/view/addmonitor.js - About 1 day to fix

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

              setAddCategoryValidation : function() {
                  // grab form data
                  this.form = $('#addCategoryForm');
                  // set up form validation
                  this.validator = this.form.validate({
      Severity: Major
      Found in public/rearview-src/js/view/addcategory.js and 1 other location - About 1 day to fix
      public/rearview-src/js/view/adddashboard.js on lines 44..70

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

      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

              setAddDashboardValidation : function() {
                  // grab form data
                  this.form = $('#addDashboardForm');
      
                  // set up form validation
      Severity: Major
      Found in public/rearview-src/js/view/adddashboard.js and 1 other location - About 1 day to fix
      public/rearview-src/js/view/addcategory.js on lines 60..85

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

      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

              setCronScheduleDaysDisabled : function(disabled) {
                if(disabled) {
                  if(!this.cronScheduleDaysDisabled) {
                    $('#inputDays').parsley('ParsleyField').reset();
                    $('#inputDays').val('?');
      Severity: Major
      Found in public/rearview-src/js/view/addmonitor.js and 1 other location - About 5 hrs to fix
      public/rearview-src/js/view/expandedmonitor.js on lines 146..162

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

      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

              setCronScheduleDaysDisabled : function(disabled) {
                if(disabled) {
                  if(!this.cronScheduleDaysDisabled) {
                    $('#inputDays').parsley('ParsleyField').reset();
                    $('#inputDays').val('?');
      Severity: Major
      Found in public/rearview-src/js/view/expandedmonitor.js and 1 other location - About 5 hrs to fix
      public/rearview-src/js/view/addmonitor.js on lines 196..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 151.

      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

              setCronScheduleValidation : function() {
                  this.cronScheduleForm = $('#cronScheduleForm');
                  var validator = CronUtil.parsleyValidator();
                  _.extend(validator,{
                      errors: {
      Severity: Major
      Found in public/rearview-src/js/view/addmonitor.js and 1 other location - About 5 hrs to fix
      public/rearview-src/js/view/expandedmonitor.js on lines 170..188

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

      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

              setCronScheduleValidation : function() {
                  this.cronScheduleForm = $('#cronScheduleFormEdit');
                  var validator = CronUtil.parsleyValidator();
                  _.extend(validator,{
                      errors: {
      Severity: Major
      Found in public/rearview-src/js/view/expandedmonitor.js and 1 other location - About 5 hrs to fix
      public/rearview-src/js/view/addmonitor.js on lines 272..291

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

      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 base.js has 382 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      define([
          'jquery',     
          'underscore', 
          'backbone',
          'handlebars',
      Severity: Minor
      Found in public/rearview-src/js/view/base.js - About 5 hrs to fix

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

        define([
            'view/base',
            'model/monitor',
            'collection/monitor',
            'view/smallmonitor',
        Severity: Minor
        Found in public/rearview-src/js/view/dashboard.js - About 5 hrs to fix

          Function Templar has 118 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Backbone.Templar = function( templatePaths, options ) {
                  // if no options are passed
                  var options           = ( typeof options === 'undefined' ) ? {} : options,
                      templateExtension = ( options.ext ) ? options.ext : config.ext,
                      baseUrlPath       = ( options.url ) ? options.url : config.url,
          Severity: Major
          Found in public/rearview-src/js/util/templar.js - About 4 hrs to fix

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

                    _cleanUp : function() {
                        this.$el.find('#categoryName').val('');
                        this.$el.find('#categoryDescription').val('');
                        this.$el.find('#categoryName').parent().removeClass('error');
                        this.validator.resetForm();
            Severity: Major
            Found in public/rearview-src/js/view/addcategory.js and 1 other location - About 3 hrs to fix
            public/rearview-src/js/view/adddashboard.js on lines 156..162

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

            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

                    _cleanUp : function() {
                        this.$el.find('#dashboardName').val('');
                        this.$el.find('#dashboardDescription').val('');
                        this.$el.find('#dashboardName').parent().removeClass('error');
                        this.validator.resetForm();
            Severity: Major
            Found in public/rearview-src/js/view/adddashboard.js and 1 other location - About 3 hrs to fix
            public/rearview-src/js/view/addcategory.js on lines 234..240

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

            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 smallmonitor.js has 298 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            define([
                'view/base'
            ], function(
                BaseView
            ){
            Severity: Minor
            Found in public/rearview-src/js/view/smallmonitor.js - About 3 hrs to fix

              Function renderGraphData has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      renderGraphData : function(chart, graphData) {
                          var self       = this,
                              renderData = graphData,
                              times      = [],
                              colors     = [      // creating an array to a series color scheme to stay consistant between updates from the server
              Severity: Major
              Found in public/rearview-src/js/view/base.js - About 3 hrs to fix

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

                        setMetricsValidation : function() {
                            $.validator.addMethod('code', function(value, element) {
                                var mirror  = $(element).data('CodeMirror'),
                                    wrapper = $( mirror.getWrapperElement() );
                                return this._validateMirror(mirror);
                Severity: Major
                Found in public/rearview-src/js/view/addmonitor.js - About 2 hrs to fix

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

                          parse : function(response, options) {
                              response.createdAt = ( response.createdAt ) 
                                                 ? this.formatServerDateTime(response.createdAt)
                                                 : response.createdAt;
                              
                  Severity: Major
                  Found in public/rearview-src/js/model/monitor.js and 1 other location - About 2 hrs to fix
                  public/rearview-src/js/model/dashboard.js on lines 25..34

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

                  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

                          parse : function(response, options) {
                              response.createdAt = ( response.createdAt ) 
                                                 ? this.formatServerDateTime(response.createdAt)
                                                 : response.createdAt;
                              
                  Severity: Major
                  Found in public/rearview-src/js/model/dashboard.js and 1 other location - About 2 hrs to fix
                  public/rearview-src/js/model/monitor.js on lines 36..45

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

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

                          addPopover : function() {
                              var self = this;
                              jobAlertIdList = _.uniq(self.jobAlertList);
                  
                              for (var i = jobAlertIdList.length - 1; i >= 0; i--) {
                  Severity: Major
                  Found in public/rearview-src/js/view/alerttimeline.js - About 2 hrs to fix

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

                                    onKeyEvent   : function(i, e) {
                                        if (( e.keyCode == 70 && e.ctrlKey ) && e.type == 'keydown') {
                                            e.stop();
                                            return this._toggleFullscreen(expressionsCodeSelector, this.expressionsMirror, $closeButton, $backButton);
                                        }
                    Severity: Major
                    Found in public/rearview-src/js/view/addmonitor.js and 1 other location - About 2 hrs to fix
                    public/rearview-src/js/view/addmonitor.js on lines 589..594

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language