Showing 370 of 370 total issues

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

            this.App.setTitle('List: ' + (this.model.isNew() ? 'New':this.model.get('id')));
Severity: Major
Found in htdocs/assets/js/views/lists/list.js and 4 other locations - About 40 mins to fix
htdocs/assets/js/views/groups/group.js on lines 135..135
htdocs/assets/js/views/reports/report.js on lines 119..119
htdocs/assets/js/views/searches/search.js on lines 510..510
htdocs/assets/js/views/users/user.js on lines 34..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 48.

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

            this.App.setTitle('Search: ' + (this.model.isNew() ? 'New':this.model.get('id')));
Severity: Major
Found in htdocs/assets/js/views/searches/search.js and 4 other locations - About 40 mins to fix
htdocs/assets/js/views/groups/group.js on lines 135..135
htdocs/assets/js/views/lists/list.js on lines 53..53
htdocs/assets/js/views/reports/report.js on lines 119..119
htdocs/assets/js/views/users/user.js on lines 34..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 48.

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

        registerView: function() {
            var view = View.prototype.registerView.apply(this, arguments);
            this.listenTo(view, 'change', this.setPendingChanges);
            return view;
        }
Severity: Minor
Found in htdocs/assets/js/views/model.js and 1 other location - About 40 mins to fix
htdocs/assets/js/views/searches/search.js on lines 93..98

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

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

        initializeSubView: function(model) {
            var view = TableView.prototype.initializeSubView.call(this, model);

            this.listenTo(view, 'button:delete', this.deleteModel);
            return view;
Severity: Minor
Found in htdocs/assets/js/views/searches/search.js and 1 other location - About 40 mins to fix
htdocs/assets/js/views/model.js on lines 154..158

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

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 initAssigneeSelect has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    var initAssigneeSelect = function(elems, users, groups, search, options) {
Severity: Minor
Found in htdocs/assets/js/util.js - About 35 mins to fix

    Function loadCollectionsAndModel has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            loadCollectionsAndModel: function(collections, collection, id, func, deferred) {
    Severity: Minor
    Found in htdocs/assets/js/views/model.js - About 35 mins to fix

      Method generateClauses has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          protected static function generateClauses($count=null, $offset=null, $sort=[], $group=[], $reverse=null) {
      Severity: Minor
      Found in phplib/Model.php - About 35 mins to fix

        Method getByQuery has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function getByQuery(array $query=[], $count=null, $offset=null, $sort=[], $reverse=null) {
        Severity: Minor
        Found in phplib/Model.php - About 35 mins to fix

          Method countByQuery has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function countByQuery(array $query=[], $count=null, $offset=null, $sort=[], $reverse=null) {
          Severity: Minor
          Found in phplib/Model.php - About 35 mins to fix

            Method getAlerts has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function getAlerts($query, $from, $to, $offset, $count) {
            Severity: Minor
            Found in phplib/ESClient.php - About 35 mins to fix

              Method sendAlertEmail has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static function sendAlertEmail($to, $search, $alerts, $content_only, $debug_data=[]) {
              Severity: Minor
              Found in phplib/Notification.php - About 35 mins to fix

                Method mail has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static function mail($to, $from, $title, $message, $file=null) {
                Severity: Minor
                Found in phplib/Notification.php - About 35 mins to fix

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

                          _render: function() {
                              NavbarView.prototype._render.call(this);
                  
                              this.App.registerSelectableKbdShortcut('d', 'delete', 'Delete the current item', false);
                          },
                  Severity: Minor
                  Found in htdocs/assets/js/views/alerts/alert.js and 1 other location - About 35 mins to fix
                  htdocs/assets/js/views/searches/searches.js on lines 110..114

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

                  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

                              if(!_.isUndefined(from)) {
                                  this.$('.time-a input[name=from]').val(from);
                                  params.from = from;
                              }
                  Severity: Minor
                  Found in htdocs/assets/js/views/alerts/alerts.js and 1 other location - About 35 mins to fix
                  htdocs/assets/js/views/alerts/alerts.js on lines 223..226

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

                  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

                              if(!_.isUndefined(to)) {
                                  this.$('.time-b input[name=to]').val(to);
                                  params.to = to;
                              }
                  Severity: Minor
                  Found in htdocs/assets/js/views/alerts/alerts.js and 1 other location - About 35 mins to fix
                  htdocs/assets/js/views/alerts/alerts.js on lines 219..222

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

                  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

                      var Group = Model.extend({
                          urlRoot: Config.api_root + 'group',
                          defaults: function() {
                              return $.extend(true, {}, Data.Group.Defaults);
                          },
                  Severity: Minor
                  Found in htdocs/assets/js/models/group.js and 1 other location - About 35 mins to fix
                  htdocs/assets/js/models/user.js on lines 12..17

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

                  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

                      var User = Model.extend({
                          urlRoot: Config.api_root + 'user',
                          defaults: function() {
                              return $.extend(true, {}, Data.User.Defaults);
                          },
                  Severity: Minor
                  Found in htdocs/assets/js/models/user.js and 1 other location - About 35 mins to fix
                  htdocs/assets/js/models/group.js on lines 12..17

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

                  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() {
                              NavbarView.prototype._render.call(this);
                  
                              this.App.registerSelectableKbdShortcut('l', 'clone', 'Clone the current item', false);
                          },
                  Severity: Minor
                  Found in htdocs/assets/js/views/searches/searches.js and 1 other location - About 35 mins to fix
                  htdocs/assets/js/views/alerts/alert.js on lines 128..132

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

                  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

                      private function processAutoclose($date, $backfill) {
                          // Run hourly.
                          $lastjob = JobFinder::getLastByQuery(['type' => Autoclose_Job::$TYPE]);
                          if(is_null($lastjob) || $date - $lastjob['target_date'] >= 1 * 60 * 60 - 5) {
                              $autoclosejob = new Autoclose_Job();
                  Severity: Minor
                  Found in phplib/Scheduler.php and 1 other location - About 35 mins to fix
                  phplib/Scheduler.php on lines 279..287

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

                  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

                      private function processCleanup($date) {
                          // Run daily.
                          $lastjob = JobFinder::getLastByQuery(['type' => Cleanup_Job::$TYPE]);
                          if(is_null($lastjob) || $date - $lastjob['target_date'] >= 24 * 60 * 60 - 5) {
                              $cleanupjob = new Cleanup_Job();
                  Severity: Minor
                  Found in phplib/Scheduler.php and 1 other location - About 35 mins to fix
                  phplib/Scheduler.php on lines 265..273

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

                  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