talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Function initFields has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    initFields: function(){
        var cm = this.grid.getColumnModel(), pm = Ext.layout.ContainerLayout.prototype.parseMargins;
        this.removeAll(false);
        for(var i = 0, len = cm.getColumnCount(); i < len; i++){
            var c = cm.getColumnAt(i),
Severity: Minor
Found in app/assets/javascripts/ext_extensions/RowEditor.js - About 1 hr 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 setActiveTab has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    setActiveTab : function(item){
        item = this.getComponent(item);
        if(this.fireEvent('beforetabchange', this, item, this.activeTab) === false){
            return;
        }

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

    sortData: function () {
        var sortInfo = this.hasMultiSort ? this.multiSortInfo : this.sortInfo,
            direction = sortInfo.direction || "ASC",
            sorters = sortInfo.sorters,
            sortFns = [];
Severity: Minor
Found in app/assets/javascripts/ext_extensions/PagingStore.js - About 1 hr 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 setActiveTab has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  setActiveTab : function(item){
      item = this.getComponent(item);
      if(this.fireEvent('beforetabchange', this, item, this.activeTab) === false){
        return;
      }
Severity: Minor
Found in app/assets/javascripts/ext_extensions/PillPanel.js - About 1 hr 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 tab_me has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def tab_me(paths)
    paths = [paths] unless paths.class.name == "Array"

    paths.each do |path|
      case path.class.name
Severity: Minor
Found in app/helpers/application_helper.rb - About 1 hr 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_statistics has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def update_statistics(options)
    aa_size = nil

    return unless respond_to? :call_down_messages
    if options[:response] && options[:response].to_i > 0
Severity: Minor
Found in app/models/alert.rb - About 1 hr 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 create has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    paramsWithCSVInvitees unless params[:invitation][:csvfile].blank?
    params[:invitation].delete("csvfile")
    params[:invitation][:author_id] = current_user.id

Severity: Minor
Found in app/controllers/admin/invitations_controller.rb - About 1 hr 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 recent_posts has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def recent_posts
    params[:forums].delete('')
    forums = if params[:forums].blank?
      Forum.for_user(current_user)
    else
Severity: Minor
Found in app/controllers/topics_controller.rb - About 1 hr 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 normalize_record has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def normalize_record(record)
    return nil unless record['DN'] && record['displayName'] && record['mail']

    jur=ou_to_jur(record['DN'])
    displayname=record['displayName'].split(/\s/).reject{|item| item.blank?}.join(" ")
Severity: Minor
Found in lib/user_contact_normalizer.rb - About 1 hr 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 initComponent has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  initComponent: function(){
    this.setTitle(this.state == 'new' ? 'New Role' : 'Edit Role');
    
    var form_opts = {};
    if(this.state == 'new'){
Severity: Minor
Found in app/assets/javascripts/admin/apps/view/RoleWindow.js - About 1 hr to fix

    Function renderElements has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        renderElements : function(n, a, targetNode, bulkRender){
            this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
    
            var t = n.getOwnerTree();
            var cols = t.columns;
    Severity: Minor
    Found in app/assets/javascripts/ext/src/debug.js - About 1 hr to fix

      Function constructor has 39 lines of code (exceeds 25 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 1 hr to fix

        Function toggleSourceEdit has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            toggleSourceEdit : function(sourceEditMode){
                var iframeHeight,
                    elHeight;
        
                if (sourceEditMode === undefined) {
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/form/HtmlEditor.js - About 1 hr to fix

          Function constrainXY has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              constrainXY : function(){
                  if(this.constrain){
                      var vw = Ext.lib.Dom.getViewWidth(),
                          vh = Ext.lib.Dom.getViewHeight();
                      var s = Ext.getDoc().getScroll();
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/Layer.js - About 1 hr to fix

            Function slideOut has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                slideOut : function(){
                    if(this.isSlid || this.el.hasActiveFx()){
                        return;
                    }
                    this.isSlid = true;
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/layout/BorderLayout.js - About 1 hr to fix

              Function ghost has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ghost : function(anchor, o){
                      o = getObject(o);
                      var me = this,
                          dom = me.dom,
                          st = dom.style,
              Severity: Minor
              Found in app/assets/javascripts/ext/src/ext-core/src/core/Fx.js - About 1 hr to fix

                Function init has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    init : function() {
                        var me = this;
                        
                        // Some arrays we are going to store data in
                        this.values = [];
                Severity: Minor
                Found in app/assets/javascripts/ext/src/ext-core/examples/rating/rating.js - About 1 hr to fix

                  Function update has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function update(event)    {
                          if($.tooltip.blocked)
                              return;
                          
                          if (event && event.target.tagName == "OPTION") {
                  Severity: Minor
                  Found in app/assets/javascripts/jquery-tooltip/jquery.tooltip.js - About 1 hr to fix

                    Method approve has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def approve
                        role_req=RoleRequest.find(params[:id])
                        if role_req
                          if current_user.is_admin_for?(role_req.jurisdiction)
                            role_req.approve!(current_user)
                    Severity: Minor
                    Found in app/controllers/admin/role_requests_controller.rb - About 1 hr to fix

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

                              return this.each(function(i){
                                  // Set all the styles
                                  for ( name in options )
                                      jQuery.attr(
                                          type ?
                      Severity: Major
                      Found in app/assets/javascripts/jquery.js and 1 other location - About 1 hr to fix
                      app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 186..195

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

                      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