talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Avoid deeply nested control flow statements.
Open

                        if (mo && parent != elem && $.css(parent, 'overflow') != 'visible') {
                            x += num(parent, 'borderLeftWidth');
                            y += num(parent, 'borderTopWidth');
                        }
Severity: Major
Found in app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js - About 45 mins to fix

    Function bindStore has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        bindStore: function (store, initial) {
            var doLoad;
            if (!initial && this.store) {
                if (store !== this.store && this.store.autoDestroy) {
                    this.store.destroy();
    Severity: Minor
    Found in app/assets/javascripts/ext_extensions/PagingStore.js - About 45 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

    Avoid deeply nested control flow statements.
    Open

                            if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName) )
                                r.push( c );
    Severity: Major
    Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ( m[1] == "." )
                                  r = jQuery.classFilter( r, m[2] );
      Severity: Major
      Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 45 mins to fix

        Function handleOffsetReturn has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        var handleOffsetReturn = function(elem, options, x, y, sl, st) {
        Severity: Minor
        Found in app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js - About 45 mins to fix

          Function remove has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              remove: function (record) {
                  if (Ext.isArray(record)) {
                      Ext.each(record, function (r) {
                          this.remove(r);
                      }, this);
          Severity: Minor
          Found in app/assets/javascripts/ext_extensions/PagingStore.js - About 45 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

          Avoid deeply nested control flow statements.
          Open

                                  if ( elem.id != match[3] )
                                      return jQuery().find( selector );
          
                                  // Otherwise, we inject the element directly into the jQuery object
                                  else {
          Severity: Major
          Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if ( m[1] == "#" ) {
                                        var tmp = [];
            
                                        // Try to find the element with the ID
                                        for ( var i = 0; r[i]; i++ )
            Severity: Major
            Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if ( option.selected ) {
                                          // Get the specifc value for the option
                                          value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value;
                                          
                                          // We don't need an array for one selects
              Severity: Major
              Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
                                            oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
                Severity: Major
                Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if ( add ^ not )
                                          tmp.push( node );
                  Severity: Major
                  Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 45 mins to fix

                    Function buildMenu has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        buildMenu: function(menuConfig)
                        {
                            // check and see if a string was sent in. These will be things like '->', ' ' and '-' for the fill, spacer, and separator shortcuts
                            if(Ext.isString(menuConfig))
                                return menuConfig;
                    Severity: Minor
                    Found in app/assets/javascripts/dashboard/menu_builder.js - About 45 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

                    Avoid deeply nested control flow statements.
                    Open

                                        if ( first == 0 ) {
                                            if ( node.nodeIndex == last )
                                                add = true;
                                        } else if ( (node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0 )
                                            add = true;
                    Severity: Major
                    Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (options.scroll) {
                                                  // get scroll offsets
                                                  sl += parent.scrollLeft;
                                                  st += parent.scrollTop;
                                              }
                      Severity: Major
                      Found in app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                for ( ; n; n = n.nextSibling )
                                                    if ( n.nodeType == 1 ) {
                                                        var id = jQuery.data(n);
                        
                                                        if ( m == "~" && merge[id] ) break;
                        Severity: Major
                        Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                  } else if ( isArray( item ) && ( length = item[ STR_LENGTH ] ) ) {
                                      
                                      if ( item.P ) {
                                          
                                          var i = 0,
                          Severity: Major
                          Found in app/assets/javascripts/lib/dominoes-1.0-rc2.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        rm.jurisdiction = pj if pj
                            Severity: Major
                            Found in app/controllers/users_controller.rb - About 45 mins to fix

                              Method sanitize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def sanitize(conditions,exclude=[:phone])
                                    return unless conditions
                                    email = /[:"\*\!&]/
                                    other = /[:"@\-\*\!\~\&]/
                                    conditions.reject{ |k,v| exclude.include? k }.each do |k,v|
                              Severity: Minor
                              Found in app/controllers/search_modules/search.rb - About 45 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

                              Method get_text_response has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def get_text_response(resp, message_hash)
                                  unless resp.ref.blank?
                                    if message_hash[resp.ref]
                                      return message_hash[resp.ref][:value] if message_hash[resp.ref][:value]
                                      return message.Messages.select{|m| m.name == message_hash[resp.ref][:ref]}.first.Value unless message_hash[resp.ref][:ref].blank? # check for blank as m.name will never be blank
                              Severity: Minor
                              Found in app/models/service/talho/email/message.rb - About 45 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 constructor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  constructor: function(config)
                                  {
                                      Ext.apply(this, config);
                              
                                      Talho.Article3Panel.superclass.constructor.call(this, config);
                              Severity: Minor
                              Found in app/assets/javascripts/dashboard/article3panel.js - About 45 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

                              Severity
                              Category
                              Status
                              Source
                              Language