Showing 370 of 370 total issues

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

                    var cdata = {
                        labels: chartdata[0],
                        datasets: [_.extend({lineTension:0, data: chartdata[1], label: 'Created'}, ChartView.colors[0])],
                    };
Severity: Major
Found in htdocs/assets/js/views/searches/search.js and 1 other location - About 1 hr to fix
htdocs/assets/js/views/index.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 55.

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

Method search has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function search($date, $settings, $query_list, $fields, $date_field, $date_type, $result_type, $filter_range) {
Severity: Major
Found in phplib/Search/Elasticsearch.php - About 1 hr to fix

    Method sendRollupEmail has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function sendRollupEmail($to, $new_alerts, $actions, $searches, $action_alerts, $active_alerts, $content_only=false, $debug_data=[]) {
    Severity: Major
    Found in phplib/Notification.php - About 1 hr to fix

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

              buttons: [
                  {name: 'Clear', type: 'default', action: 'clear', persist: true, clear: true},
                  {name: 'Search', type: 'primary', icon: 'search', action: 'search'},
              ],
      Severity: Major
      Found in htdocs/assets/js/views/searches/searches.js and 1 other location - About 1 hr to fix
      htdocs/assets/js/views/alerts/alerts.js on lines 30..33

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

      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

              buttons: [
                  {name: 'Clear', type: 'default', action: 'clear', persist: true, clear: true},
                  {name: 'Search', type: 'primary', icon: 'search', action: 'search'},
              ],
      Severity: Major
      Found in htdocs/assets/js/views/alerts/alerts.js and 1 other location - About 1 hr to fix
      htdocs/assets/js/views/searches/searches.js on lines 41..44

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

      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

                              _.extend({lineTension:0, data: _.pluck(this.data.historical_actions[1], 1), label: 'Assigned'}, ChartView.colors[1]),
      Severity: Major
      Found in htdocs/assets/js/views/index.js and 1 other location - About 1 hr to fix
      htdocs/assets/js/views/index.js on lines 70..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 55.

      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

                              _.extend({lineTension:0, data: _.pluck(this.data.historical_actions[2], 1), label: 'Resolved'}, ChartView.colors[3]),
      Severity: Major
      Found in htdocs/assets/js/views/index.js and 1 other location - About 1 hr to fix
      htdocs/assets/js/views/index.js on lines 69..69

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

      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

              render: function(key, val, data) {
                  if(_.isObject(data)) {
                      return TableRenderer.tabulate(data);
                  }
                  return Handlebars.Utils.escapeExpression(val);
      Severity: Minor
      Found in htdocs/assets/js/views/renderer/ip.js and 1 other location - About 55 mins to fix
      htdocs/assets/js/views/renderer/mac.js on lines 19..24

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

      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

              render: function(key, val, data) {
                  if(_.isObject(data)) {
                      return TableRenderer.tabulate(data);
                  }
                  return Handlebars.Utils.escapeExpression(val);
      Severity: Minor
      Found in htdocs/assets/js/views/renderer/mac.js and 1 other location - About 55 mins to fix
      htdocs/assets/js/views/renderer/ip.js on lines 29..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 54.

      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 GET has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function GET(array $get) {
              $jira_data = [
                  'Issues' => [],
                  'Users' => [],
              ];
      Severity: Minor
      Found in phplib/REST/Data/Jira.php - About 55 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function preview has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function preview($get, $data) {
              if(!$this->allowCreate()) {
                  throw new ForbiddenException;
              }
      
      
      Severity: Minor
      Found in phplib/REST/Searches.php - About 55 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function getTypes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getTypes() {
              static $type_map = null;
              if(is_null($type_map)) {
                  $type_map = [];
                  // Populate the list of types.
      Severity: Minor
      Found in phplib/TypeModel.php - About 55 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          Handlebars.registerHelper('ifneq', function(a, b, options) {
              return a != b ? options.fn(this):options.inverse(this);
          });
      Severity: Minor
      Found in htdocs/assets/js/helper.js and 1 other location - About 55 mins to fix
      htdocs/assets/js/helper.js on lines 30..32

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

      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

          Handlebars.registerHelper('ifeq', function(a, b, options) {
              return a == b ? options.fn(this):options.inverse(this);
          });
      Severity: Minor
      Found in htdocs/assets/js/helper.js and 1 other location - About 55 mins to fix
      htdocs/assets/js/helper.js on lines 34..36

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

      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

      Method generateQuery has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Method backtrace has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function backtrace($label, $desc, $file, $line, $bt=null, $skip=0, $ns='NONE') {
        Severity: Major
        Found in phplib/Logger.php - About 50 mins to fix

          Method sendSummaryEmail has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function sendSummaryEmail($to, $start_date, $stats, $leaders, $noisy_searches, $quiet_searches, $debug_data=[]) {
          Severity: Major
          Found in phplib/Notification.php - About 50 mins to fix

            Method query has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private function query($query, $fields=null, $from=null, $to=null, $scroll=false, $offset=null, $count=null) {
            Severity: Major
            Found in phplib/ESClient.php - About 50 mins to fix

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

              define(function(require) {
                  var Collection = require('collection'),
                      Group = require('models/group'),
                      Config = require('config');
              
              
              Severity: Major
              Found in htdocs/assets/js/collections/group.js and 4 other locations - About 50 mins to fix
              htdocs/assets/js/collections/list.js on lines 2..14
              htdocs/assets/js/collections/report.js on lines 2..14
              htdocs/assets/js/collections/search.js on lines 2..14
              htdocs/assets/js/collections/user.js on lines 2..14

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

              define(function(require) {
                  var Collection = require('collection'),
                      List = require('models/list'),
                      Config = require('config');
              
              
              Severity: Major
              Found in htdocs/assets/js/collections/list.js and 4 other locations - About 50 mins to fix
              htdocs/assets/js/collections/group.js on lines 2..14
              htdocs/assets/js/collections/report.js on lines 2..14
              htdocs/assets/js/collections/search.js on lines 2..14
              htdocs/assets/js/collections/user.js on lines 2..14

              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

              Severity
              Category
              Status
              Source
              Language