Showing 18,390 of 18,390 total issues
Method exp_add_joiner
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exp_add_joiner(exp, token, joiner)
if exp[:token] && exp[:token] == token # If the token matches
exp.keys.each do |key| # Find the key
if key == :token
exp.delete(key) # Remove the :token key
- Create a ticketCreate a ticket
Method exp_build_string
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exp_build_string(exp)
main_font = calculate_font_color(exp['result'])
if exp['and']
exp_string = join_binary(exp, 'and', main_font)
- Create a ticketCreate a ticket
Method button_set_record_vars
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def button_set_record_vars(button)
button.name = @edit[:new][:name]
button.description = @edit[:new][:description]
button.applies_to_class = x_active_tree == :ab_tree ? @resolve[:target_class] : "ServiceTemplate"
button.applies_to_id = x_active_tree == :ab_tree ? nil : @sb[:applies_to_id]
- Create a ticketCreate a ticket
Method adv_search_clear
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def adv_search_clear
respond_to do |format|
format.js do
@explorer = true
if x_active_tree.to_s =~ /_filter_tree$/ &&
- Create a ticketCreate a ticket
Method fetch_saved_report
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fetch_saved_report(id)
rr = MiqReportResult.for_user(current_user).find_by(:id => id)
if rr.nil? # Saved report no longer exists
@report = nil
add_flash(_("Error: Report no longer exists in the database"), :error)
- Create a ticketCreate a ticket
Method timeprofile_set_days_hours
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def timeprofile_set_days_hours(_timeprofile = @timeprofile)
@timeprofile_details = {}
@timeprofiles.each do |timeprofile|
@timeprofile_details[timeprofile.description] = {}
profile_key = timeprofile.profile[:days].nil? ? "days" : :days
- Create a ticketCreate a ticket
Method forest_accept
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def forest_accept
assert_privileges("ops_settings")
forest_get_form_vars
no_changes = true
- Create a ticketCreate a ticket
Method ap_get_form_vars
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ap_get_form_vars
@scan = @edit[:scan_id] ? ScanItemSet.find(@edit[:scan_id]) : ScanItemSet.new
@edit[:new][:name] = params[:name] if params[:name]
@edit[:new][:description] = params[:description] if params[:description]
- Create a ticketCreate a ticket
Method action_handle_selection_buttons
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def action_handle_selection_buttons(members,
members_chosen = :members_chosen,
choices = :choices,
choices_chosen = :choices_chosen)
if params[:button].ends_with?("_left")
- Create a ticketCreate a ticket
Method miq_alert_set_assign
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def miq_alert_set_assign
assert_privileges("miq_alert_set_assign")
@assign = @sb[:assign]
@alert_profile = @assign[:alert_profile] if @assign
case params[:button]
- Create a ticketCreate a ticket
Method deleteemss
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def deleteemss
assert_privileges(params[:pressed])
emss = []
if @lastaction == "show_list" # showing a list, scan all selected emss
emss = find_checked_items
- Create a ticketCreate a ticket
Method show_details
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show_details(db, options = {})
association = options[:association]
scopes = options[:scopes]
@showtype = "details"
@display = "main"
- Create a ticketCreate a ticket
Method scaling
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def scaling
assert_privileges("ems_infra_scale")
# Hiding the toolbars
@in_a_form = true
- Create a ticketCreate a ticket
Method reports_get_node_info
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def reports_get_node_info
nodes = x_node.split('-')
if nodes.length == 2
@right_cell_text ||= _("%{typ} Reports") % {:typ => @sb[:rpt_menu][nodes[1].to_i][0]}
- Create a ticketCreate a ticket
Method explorer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def explorer
@explorer = true
@lastaction = "explorer"
@ght_type = nil
@report = nil
- Create a ticketCreate a ticket
Method update
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update(params)
if params[:chosen_pivot1] && params[:chosen_pivot1] != by1
self.by1 = params[:chosen_pivot1]
if params[:chosen_pivot1] == NOTHING_STRING
self.by2 = NOTHING_STRING
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
def textual_group_options
options = []
DDF.traverse(:fields => @record.class::API_ATTRIBUTES) do |field|
next if field[:type].to_s == 'password' || field[:name].nil?
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 62.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
def textual_group_options
options = []
DDF.traverse(:fields => @record.class::API_ATTRIBUTES) do |field|
next if field[:type].to_s == 'password' || field[:name].nil?
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 62.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def groups
return unless init_show_variables
@lastaction = "groups"
id = params[:show] || params[:x_show]
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 62.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def users
return unless init_show_variables
@lastaction = "users"
id = params[:show] || params[:x_show]
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 62.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76