metaminded/tabulatr2

View on GitHub

Showing 24 of 626 total issues

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

  retrievePage: function(table, hash){
    table.find('tbody tr').hide();
    if(table.find('tbody tr[data-page='+ hash.page +']').length > 0){
      table.find('tbody tr[data-page='+ hash.page +']').show();

Severity: Minor
Found in app/assets/javascripts/tabulatr/_tabulatr.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 prepareTableForInsert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  prepareTableForInsert: function(tableId, append, dataCount, actualCount){
    if(!append){
      if(this.storePage){
        $('#'+ tableId +' tbody tr').hide();
      }else{
Severity: Minor
Found in app/assets/javascripts/tabulatr/_tabulatr.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 getPageParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  getPageParams: function(hash){
    var pagesize = hash.pagesize;
    if(pagesize === undefined){
      pagesize = $('table#'+ this.id).data('pagesize');
    }
Severity: Minor
Found in app/assets/javascripts/tabulatr/_tabulatr.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 insert_attribute_in_hash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def self.insert_attribute_in_hash at, f, r={}
    action = at[:action].to_sym
    relation = at[:relation].try(:to_sym)
    if at.has_key? :relation
      check_if_attribute_is_in_hash(f, relation)
Severity: Minor
Found in lib/tabulatr/json_builder.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