talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Function onRowClick has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    onRowClick: function(g, rowIndex, e){
      if(this.isValid()) {
        if(this.clicksToEdit == 'auto'){
            var li = this.lastClickIndex;
            this.lastClickIndex = rowIndex;
Severity: Minor
Found in app/assets/javascripts/ext_extensions/RowEditor.js - About 35 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 calculateChildBoxes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    calculateChildBoxes: function(visibleItems, targetSize)
    {
        for (i = 0; i < visibleItems.length; i++) {
            child       = visibleItems[i];

Severity: Minor
Found in app/assets/javascripts/ext_extensions/MaxWidthHBox.js - About 35 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 initTemplates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    initTemplates : function()
    {
        var ts = this.templates || {};
        
        if (!ts.row) {
Severity: Minor
Found in app/assets/javascripts/ext_extensions/TreeGrid/src/GridView.js - About 35 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 initTemplates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    initTemplates : function()
    {
        var ts = this.templates || {};
        
        if (!ts.row) {
Severity: Minor
Found in app/assets/javascripts/ext_extensions/TreeGrid/TreeGrid.js - About 35 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 onRemove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    onRemove : function(c){
        var te = Ext.get(c.tabEl);
        // check if the tabEl exists, it won't if the tab isn't rendered
        if(te){
            te.select('a').removeAllListeners();

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

Ext.ux.tot2ivn.VrTabPanel.AccessStack = function(){
    var items = [];
    return {
        add : function(item){
            items.push(item);

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

    init:function(component){
        var originalSetValue = component.setValue;
        var negValue = this.uncheckedValue;

        var buildInputElement = function(el, name){
Severity: Minor
Found in app/assets/javascripts/ext_extensions/SubmitFalse.js - About 35 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 password has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  password : function(value, field){
    if (field.initialPassword){
      var pwd     = null;
      var curr_ct = field.ownerCt;
      while(curr_ct.ownerCt){
Severity: Minor
Found in app/assets/javascripts/ext_extensions/validations.js - About 35 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 valid has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def valid
    unless (submitter = User.find_by_email(@email))
      return "bad-email"
    end
    unless @jurisdiction.blank? || submitter.jurisdictions.find_by_name(@jurisdiction)
Severity: Minor
Found in app/models/user_batch.rb - About 35 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 fetch_jurisdictions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def fetch_jurisdictions(options={})
      return [] if options.empty?
      if ( options[:age] && (Jurisdiction.recent(1).first.updated_at.utc.to_i == options[:age]) )
        return []
      end
Severity: Minor
Found in app/controllers/jurisdictions_controller.rb - About 35 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 indexOf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

qq.indexOf = function(arr, elt, from){
    if (arr.indexOf) return arr.indexOf(elt, from);
    
    from = from || 0;
    var len = arr.length;    
Severity: Minor
Found in app/assets/javascripts/lib/fileuploader.js - About 35 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 find_for has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def self.find_for(id,user)
    options = hide_conditions !user.is_super_admin?
    result = self.find(id,options)
    return result unless result
    unless result.kind_of?(Array)
Severity: Minor
Found in app/models/forum.rb - About 35 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 permissions= has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def permissions= (permission_attributes)
    permission_attributes = JSON.parse(permission_attributes) if(permission_attributes.class == String)
    possible_removed_permissions = permission_attributes.select { |x| x['permission'] == 0 }
    permission_attributes.reject! { |x| x['permission'] == 0 }

Severity: Minor
Found in app/models/folder.rb - About 35 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 permissions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def permissions
    perms = folder_permissions
    if share_status == 'inherited'
      #find the parent that we have inherited from
      folder = parent
Severity: Minor
Found in app/models/folder.rb - About 35 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 rewrite_level has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def rewrite_level(folder)
    @folders.each do |f|
      if f.parent_id == folder.id
        f.level = folder.level + 1
        rewrite_level(f) unless f.leaf?
Severity: Minor
Found in app/helpers/documents_helper.rb - About 35 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 paginate_for has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def self.paginate_for(id,user,page,per_page=10)
    options = hide_conditions !user.is_super_admin?
    result = self.find(id,options)
    return result unless result
    unless result.kind_of?(Array)
Severity: Minor
Found in app/models/forum.rb - About 35 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 check_uniq_device has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def check_uniq_device
    if options.blank?
      errors.add(:base, "Device is blank")
    else
      devices = Device.find_all_by_user_id_and_type(user_id, type)
Severity: Minor
Found in app/models/device.rb - About 35 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 xml_build_recipients has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def xml_build_recipients builder, options={}
    options={} if options.blank?
    builder.Recipients do |rcpts|
      if options[:override]
        options[:override].call(rcpts)
Severity: Minor
Found in app/models/alert.rb - About 35 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 add_program has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def add_program(xml)
    xml.program :name => "TXPhin Alert ##{alert.id}", :desc => alert.title, :channel => "outdial", :template => "#{alert.acknowledge? ? 9 : 0}" do
      xml.addresses :address => "c1", :retry_num => "0", :retry_wait => "0"
      xml.content do
        if alert.message_recording_file_name.blank?
Severity: Minor
Found in app/models/service/tfcc/phone/alert.rb - About 35 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 add_notification_responses has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def add_notification_responses(xml)
    unless message.IVRTree.blank?
      provider = message.Behavior.Delivery.Providers.select{|c| c.name == "swn" && c.device == "Phone"}.first

      message.IVRTree.select{|ivr| ivr.name == provider.ivr}.each do |ivr|
Severity: Minor
Found in app/models/service/swn/phone/message.rb - About 35 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