talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Function setSize has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    setSize : function(w, h){

        // support for standard size objects
        if(typeof w == 'object'){
            h = w.height;
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/BoxComponent.js - About 2 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 adjustFont has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    adjustFont: function(btn){
        var adjust = btn.getItemId() == 'increasefontsize' ? 1 : -1,
            doc = this.getDoc(),
            v = parseInt(doc.queryCommandValue('FontSize') || 2, 10);
        if((Ext.isSafari && !Ext.isSafari2) || Ext.isChrome || Ext.isAir){
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/form/HtmlEditor.js - About 2 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 fitColumns has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    fitColumns : function(preventRefresh, onlyExpand, omitColumn) {
        var grid          = this.grid,
            colModel      = this.cm,
            totalColWidth = colModel.getTotalWidth(false),
            gridWidth     = this.getGridInnerWidth(),
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 2 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 JSONP has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

Ext.ux.JSONP = (function(){
    var _queue = [],
        _current = null,
        _nextRequest = function() {
            _current = null;
Severity: Minor
Found in app/assets/javascripts/ext/src/ext-core/examples/jsonp/jsonp.js - About 2 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 init has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    ,init:function(grid) {
        this.grid = grid;
        
        // the actions column must have an id for Ext 3.x
        this.id = this.id || Ext.id();
Severity: Minor
Found in app/assets/javascripts/ext_extensions/Ext.ux.grid.RowActions.js - About 2 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 DragDropTabs has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

Ext.plugin.DragDropTabs = (function() {
    var TabProxy = Ext.extend(Ext.dd.StatusProxy, {
        constructor: function(config) {
            TabProxy.superclass.constructor.call(this, config);
            // Custom class needed on the proxy so the tab can
Severity: Minor
Found in app/assets/javascripts/ext_extensions/DragDropTabs.js - About 2 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 get_version_list has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def get_version_list(params)
    # set some defaults
    params[:start] = 0 unless params[:start]
    params[:limit] =  30 unless params[:limit]
    params[:sort] = 'id' unless params[:sort]
Severity: Minor
Found in app/controllers/audits_controller.rb - About 2 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 query has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def query(args = nil)
    alert_classes = Alert.child_classes
    alert_classes.each do |alert_class|
      alert_class.active.has_acknowledge.find_each do |alert|
        next if alert.alert_attempts.with_device('Device::PhoneDevice').not_acknowledged.size == 0 && alert.alert_attempts.with_device('Device::EmailDevice').not_acknowledged.size == 0
Severity: Major
Found in lib/workers/query_swn_for_acknowledgments_worker.rb - About 2 hrs to fix

    File ext-lang-ro.js has 253 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/locale/ext-lang-ro.js - About 2 hrs to fix

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

          preventDefault: function() {
              this.isDefaultPrevented = returnTrue;
      
              var e = this.originalEvent;
              if( !e )
      Severity: Major
      Found in app/assets/javascripts/jquery.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/jquery.js on lines 2842..2853

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

      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

                          test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
                              m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
                              !/\D/.test(m[3]) && "0n+" + m[3] || m[3]),
      Severity: Major
      Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/jquery.js on lines 1803..1805

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

      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 test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
                          match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
                          !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
      Severity: Major
      Found in app/assets/javascripts/jquery.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 1708..1710

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

      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

          stopPropagation: function() {
              this.isPropagationStopped = returnTrue;
      
              var e = this.originalEvent;
              if( !e )
      Severity: Major
      Found in app/assets/javascripts/jquery.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/jquery.js on lines 2830..2841

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

      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(!Ext.isFunction(this.redirect))
              {
                  if(Ext.isFunction(this.parent.redirect_to))
                      this.redirect = this.parent.redirect_to;
                  else
      Severity: Major
      Found in app/assets/javascripts/dashboard/menu_builder.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/dashboard/menu_builder.js on lines 18..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 76.

      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(!Ext.isFunction(this.tab))
              {
                  if(Ext.isFunction(this.parent.open_tab))
                      this.tab = this.parent.open_tab;
                  else
      Severity: Major
      Found in app/assets/javascripts/dashboard/menu_builder.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/dashboard/menu_builder.js on lines 26..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 76.

      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 PagingToolbar.js has 252 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/PagingToolbar.js - About 2 hrs to fix

        Function afterrender has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                afterrender: function() {
                  var uploadButton = new Ext.ux.form.FileUploadField({
                    name: 'invitation[csvfile]',
                    itemId: 'myfileuploadfield',
                    buttonOnly: true,
        Severity: Major
        Found in app/assets/javascripts/invitations/NewInvitation.js - About 2 hrs to fix

          Function embedSWF has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
                      var callbackObj = {success:false, id:replaceElemIdStr};
                      if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
                          setVisibility(replaceElemIdStr, false);
                          addDomLoadEvent(function() {
          Severity: Major
          Found in app/assets/javascripts/ext/src/widgets/chart/swfobject.js - About 2 hrs to fix

            Function initEvents has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                initEvents : function(){
                    Ext.form.ComboBox.superclass.initEvents.call(this);
            
                    /**
                     * @property keyNav
            Severity: Major
            Found in app/assets/javascripts/ext/src/widgets/form/Combo.js - About 2 hrs to fix

              Function autoScrollTabs has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  autoScrollTabs : function(){
                      this.pos = this.tabPosition=='bottom' ? this.footer : this.header;
                      var count = this.items.length,
                          ow = this.pos.dom.offsetWidth,
                          tw = this.pos.dom.clientWidth,
              Severity: Major
              Found in app/assets/javascripts/ext/src/widgets/TabPanel.js - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language