Showing 277 of 350 total issues
Consider simplifying this complex logical expression. Open
} else if ( typeof value === "string" && !rnocache.test( value ) &&
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
value = value.replace(rxhtmlTag, "<$1></$2>");
Consider simplifying this complex logical expression. Open
elsif (code_text.match(/V\.*.*?[^\d]3[^\d]$/) || code_text.match(/V\.*.*?[^\d]4[^\d]$/)) && (header_text.match(/Názov a adresa/) || header_text.match(/NÁZOV A ADRESA/) || header_text.match(/Meno(.*)adresa(.*)víťaza/))
supplier_information = next_element(code.parent)
supplier_hash[:supplier_name] = supplier_information.xpath("./span[@class='titleValue']/span[1]").inner_text.strip
supplier_hash[:supplier_organisation_code] = supplier_information.xpath(".//span[@class='titleValue']/span[3]").inner_text.strip
Function PSEUDO
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PSEUDO: function( match, curLoop, inplace, result, not ) {
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(identifier, schema_manager, description_creator, system_columns, supported_types)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(url, reset_url = nil, cookie = nil, parent_url = nil, filter = nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(path, col_sep, encoding, skip_first_line = false, has_header = true)
Method parse_for_links
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_for_links(doc, reset_url, cookie, parent_url, filter)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(url, reset_url = nil, cookie = nil, parent_url = nil, filter = nil)
Method parse_for_links
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_for_links(doc, reset_url, cookie, parent_url, filter)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(url, reset_url = nil, cookie = nil, parent_url = nil, filter = nil)
Method parse_for_links
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_for_links(doc, reset_url, cookie, parent_url, filter)
Method update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update
@field_description = FieldDescription.find_by_id(params[:id])
respond_to do |format|
if @field_description.update_attributes(params[:field_description])
- Read upRead up
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 modal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
$.modal = function(options){
inscription_modal_remove();
options = $.extend({
position: 'center',
- Read upRead up
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 sort_link
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sort_link(field)
params[:dir] ||= "asc"
lab = html_escape(field.title).html_safe
lab += image_tag "sort_#{params["dir"]}.png" if params[:sort] == field.identifier
- Read upRead up
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 has_right?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def has_right?(right)
# Super-user has all the rights
return true if is_super_user
# Check for particular rights
- Read upRead up
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 parse_all_downloaded_documents_for_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_all_downloaded_documents_for_type(dataset_type)
ids = Dir.glob("data/#{Rails.env}/vvo/procurements/*/*.html").map { |n| File.basename(n, ".html").to_i }
ids.each_with_index do |document_id, index|
ext = Etl::VvoExtractionV2.new(document_id)
if ext.dataset_type == dataset_type
- Read upRead up
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 dataset_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.dataset_type(document_type)
return nil unless document_type
if document_type.start_with?('V') || document_type.start_with?('IP')
:notice
elsif document_type.start_with?('IZ') || document_type.start_with?('ID')
- Read upRead up
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 too many return
statements within this function. Open
return (context || rootjQuery).find( selector );
Avoid too many return
statements within this function. Open
return elem[ name ];
Avoid too many return
statements within this function. Open
return attr === null ? undefined : attr;