talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Function constructor has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    constructor: function(tree, config){
        /**
     * @cfg {Boolean} folderSort True to sort leaf nodes under non-leaf nodes (defaults to false)
     */
    /**
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/tree/TreeSorter.js - About 4 hrs 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 walkCells has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    walkCells : function(row, col, step, fn, scope){
        var cm    = this.colModel,
            clen  = cm.getColumnCount(),
            ds    = this.store,
            rlen  = ds.getCount(),
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/grid/GridPanel.js - About 4 hrs 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 loadRecords has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    loadRecords : function(o, options, success)
    {
        if (!o || success === false) {
            if (success !== false) {
                this.fireEvent("load", this, [], options);
Severity: Minor
Found in app/assets/javascripts/ext_extensions/TreeGrid/TreeGrid.js - About 4 hrs 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

Method update_it has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

  def update_it
    dashboard_json = ActiveSupport::JSON.decode(params["dashboards"]) if params["dashboards"]
    dashboard = Dashboard.with_user(current_user).with_roles('publisher', 'editor').find_by_id(params[:id])
    dashboard = Dashboard.find_by_id_and_application_default(params[:id], true) if current_user.is_super_admin? && dashboard.nil?
    
Severity: Minor
Found in app/controllers/dashboard_controller.rb - About 4 hrs 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

GroupingView has 35 functions (exceeds 20 allowed). Consider refactoring.
Open

Ext.grid.GroupingView = Ext.extend(Ext.grid.GridView, {

    /**
     * @cfg {String} groupByText Text displayed in the grid header menu for grouping by a column
     * (defaults to 'Group By This Field').
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/grid/GroupingView.js - About 4 hrs to fix

    Class User has 35 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class User < ActiveRecord::Base
      include Clearance::User  
      
      has_many :devices, :dependent => :delete_all
      accepts_nested_attributes_for :devices
    Severity: Minor
    Found in app/models/user.rb - About 4 hrs to fix

      File GroupingView.js has 354 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*!
       * Ext JS Library 3.3.0
       * Copyright(c) 2006-2010 Ext JS, Inc.
       * licensing@extjs.com
       * http://www.extjs.com/license
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/grid/GroupingView.js - About 4 hrs to fix

        Function refresh has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

            refresh : function(){
                if(this.fireEvent('beforerefresh', this) !== false){
                    var styleChanged = false;
                    // convert the store data into something YUI charts can understand
                    var data = [], rs = this.store.data.items;
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/chart/Chart.js - About 4 hrs 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 handleHdMove has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

            handleHdMove : function(e) {
                var header = this.findHeaderCell(this.activeHdRef);
                
                if (header && !this.headersDisabled) {
                    var handleWidth  = this.splitHandleWidth || 5,
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 4 hrs 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 TaskRunner has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        Ext.util.TaskRunner = function(interval){
            interval = interval || 10;
            var tasks = [], 
                removeQueue = [],
                id = 0,
        Severity: Minor
        Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 4 hrs 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 TaskRunner has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        Ext.util.TaskRunner = function(interval){
            interval = interval || 10;
            var tasks = [], 
                removeQueue = [],
                id = 0,

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

        Ext.util.TaskRunner = function(interval){
            interval = interval || 10;
            var tasks = [], 
                removeQueue = [],
                id = 0,
        Severity: Minor
        Found in app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js - About 4 hrs 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 TaskRunner has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        Ext.util.TaskRunner = function(interval){
            interval = interval || 10;
            var tasks = [], 
                removeQueue = [],
                id = 0,
        Severity: Minor
        Found in app/assets/javascripts/ext/adapter/ext/ext-base-debug.js - About 4 hrs 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

        File TreeNode.js has 350 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
         * Ext JS Library 3.3.0
         * Copyright(c) 2006-2010 Ext JS, Inc.
         * licensing@extjs.com
         * http://www.extjs.com/license
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/tree/TreeNode.js - About 4 hrs to fix

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

                      if(format && useF){
                          args = args ? ',' + args : "";
                          if(format.substr(0, 5) != "this."){
                              format = "fm." + format + '(';
                          }else{
          Severity: Major
          Found in app/assets/javascripts/ext/src/core/Template-more.js and 1 other location - About 4 hrs to fix
          app/assets/javascripts/ext/src/util/XTemplate.js on lines 396..406

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

          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 forumTpl = new Ext.XTemplate(      
                '<div class="forum-wrap" forumid="{id}">',
                  '<div class="forum-left" forumid="{id}"><table>',
                    '<tr>',
                      '<td><span class="forum-title" forum_name="{name}" forumid="{id}">{name}</span></td>',
          Severity: Major
          Found in app/assets/javascripts/forums/view/forums/Index.js and 1 other location - About 4 hrs to fix
          app/assets/javascripts/forums/view/topics/Index.js on lines 23..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 123.

          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 (format && useF) {
                          args = args ? ',' + args : "";
                          if(format.substr(0, 5) != "this."){
                              format = "fm." + format + '(';
                          }else{
          Severity: Major
          Found in app/assets/javascripts/ext/src/util/XTemplate.js and 1 other location - About 4 hrs to fix
          app/assets/javascripts/ext/src/core/Template-more.js on lines 103..113

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

          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 forumTpl = new Ext.XTemplate(      
                '<div class="forum-wrap" forumid="{id}">',
                  '<div class="forum-left" forumid="{id}"><table>',
                    '<tr>',
                      '<td><span class="forum-title" forum_name="{name}" forumid="{id}">{name}</span></td>',
          Severity: Major
          Found in app/assets/javascripts/forums/view/topics/Index.js and 1 other location - About 4 hrs to fix
          app/assets/javascripts/forums/view/forums/Index.js on lines 32..67

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

              if(jQuery.trim($('#user_display_name').val()) == "" || jQuery.trim($('#user_display_name').val()) == jQuery.trim(jQuery.trim($('#user_first_name').val()) + " " + jQuery.trim($('#user_last_name').val())))
                name_synched = true;
              else
                name_synched = false;
          Severity: Major
          Found in app/assets/javascripts/application.js and 1 other location - About 4 hrs to fix
          app/assets/javascripts/application.js on lines 81..84

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

              if(jQuery.trim($('#user_display_name').val()) == "" || jQuery.trim($('#user_display_name').val()) == jQuery.trim(jQuery.trim($('#user_first_name').val()) + " " + jQuery.trim($('#user_last_name').val())))
                name_synched = true;
              else
                name_synched = false;
          Severity: Major
          Found in app/assets/javascripts/application.js and 1 other location - About 4 hrs to fix
          app/assets/javascripts/application.js on lines 90..93

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

          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