talho/openphin

View on GitHub

Showing 1,713 of 3,486 total issues

Function onStripMouseDown has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    onStripMouseDown : function(e){
        if(e.button !== 0){
            return;
        }
        e.preventDefault();

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 6 (exceeds 5 allowed). Consider refactoring.
Open

    constructor: function(config)
    {
        Ext.apply(this, config);

        if(!Ext.isFunction(this.tab))
Severity: Minor
Found in app/assets/javascripts/dashboard/menu_builder.js - About 25 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 getTargetColumnIndex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    getTargetColumnIndex: function(pt){
        var grid = this.grid,
            v = grid.view,
            x = pt.left,
            cms = grid.colModel.config,
Severity: Minor
Found in app/assets/javascripts/ext_extensions/RowEditor.js - About 25 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 handleAJAXLoad has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    handleAJAXLoad: function(el, success, response, options)
    {
        if(!success)
        {
            (new Ext.Window({title: 'Error', html: response.responseText})).show();
Severity: Minor
Found in app/assets/javascripts/ext_extensions/AjaxPanel.js - About 25 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 markupText has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  markupText: function(text, r){
    var entities = r['entities'],
        replacements = [],
        out_text = '',
        end_i;
Severity: Minor
Found in app/assets/javascripts/dashboard/cms/portlets/twitter.js - About 25 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 mapReady has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    mapReady: function(){
      dominoes('$(ext_extensions)/GMapStyledMarker.js', function(){
        this.geocoder = new google.maps.Geocoder();
        var opts = {
          zoom: this.zoomLevel,
Severity: Minor
Found in app/assets/javascripts/ext_extensions/GMapPanel.js - About 25 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 showTooltip has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    showTooltip: function(msg){
        if (this.showToolTips !== true){
          return;
        }
        var t = this.tooltip;
Severity: Minor
Found in app/assets/javascripts/ext_extensions/RowEditor.js - About 25 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 update_with_token has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def update_with_token
    @alert_attempt = AlertAttempt.find_by_alert_id_and_token(@alert.id, params[:token])
    @current_user = @alert_attempt.user
    if @alert.respond_to?(:sensitive) && @alert.sensitive?
      error = "That resource does not exist or you do not have access to it."
Severity: Minor
Found in app/controllers/alerts_controller.rb - About 25 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 for_user has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def self.for_user(user)
    user_id = user.class == User ? user.id : user
    user = user.class == User ? user : User.find(user)
    if user.is_super_admin?
      self.scoped
Severity: Minor
Found in app/models/forum.rb - About 25 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 accessible_to has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def self.accessible_to(result,user)
    # if no audience is specified then this forum is open to anyone
    # if a audience is specified for this forum, am I in the audeience?
    if result.audience.nil?
      forum = result
Severity: Minor
Found in app/models/forum.rb - About 25 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 super_admin_in_texas_required has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def super_admin_in_texas_required
    return true if current_user.is_sysadmin?
    unless current_user.role_memberships.count(:conditions => {:role_id => Role.superadmins.map(&:id), :jurisdiction_id => Jurisdiction.find_by_name("Texas") }) > 0
      message = "That resource does not exist or you do not have access to it."
      if request.xhr?
Severity: Minor
Found in app/controllers/application_controller.rb - About 25 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 included has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def self.included(base)
    base.has_many :role_memberships, :include => [:jurisdiction, :role], :dependent => :delete_all
    base.has_many :role_requests, :dependent => :delete_all, :include => [:jurisdiction, :role]
    base.accepts_nested_attributes_for :role_requests, :organization_membership_requests
    base.has_many :roles, :through => :role_memberships, :uniq => true
Severity: Minor
Found in app/modules/user/roles_module.rb - About 25 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 show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def show
    set_toolbar
    @user = User.find(params[:user_id])

    respond_to do |format|
Severity: Minor
Found in app/controllers/user_profiles_controller.rb - About 25 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