Showing 18,390 of 18,390 total issues
Method included
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(included_class)
included_class.button_group('service_lifecycle', [
included_class.select(
:service_lifecycle_choice,
nil,
- Create a ticketCreate a ticket
Method miq_summary_alert_set_assigned
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def miq_summary_alert_set_assigned(assigned, alert_profile_tag)
rows = []
data = {:title => _('Assigned To'), :mode => "miq_alert_set_assigned"}
if !assigned[:objects].empty?
if assigned[:objects].first.kind_of?(MiqEnterprise)
- Create a ticketCreate a ticket
Method chart_selected
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def chart_selected(chart_click_data, data_row, ts)
@record = find_record_with_rbac(data_row["resource_type"].constantize, data_row["resource_id"])
return [true, nil] unless @record
# Set the perf options in the selected controller's sandbox
- Create a ticketCreate a ticket
Method check_git_task
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_git_task
assert_privileges('miq_ae_class_import_export')
task = MiqTask.find(params[:task_id])
json = if task.state != MiqTask::STATE_FINISHED
{:state => task.state}
- Create a ticketCreate a ticket
Method get_node_info
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_node_info(treenodeid, show_list = true)
# resetting action that was stored during edit to determine what is being edited
@sb[:action] = nil
@nodetype, node_id =
- Create a ticketCreate a ticket
Method policies
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def policies
@vm = @record = identify_record(params[:id], VmOrTemplate)
@lastaction = "rsop"
@showtype = "policies"
drop_breadcrumb(:name => _("Policy Simulation Details for %{name}") % {:name => @record.name},
- Create a ticketCreate a ticket
Method create
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
assert_privileges("miq_ae_class_new")
return unless load_edit("aeclass_edit__new", "replace_cell__explorer")
get_form_vars
- Create a ticketCreate a ticket
Method build_snmp_options
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_snmp_options(subkey, process_variables)
refresh = false
@edit[:new][subkey][:host] = params[:host] if params[:host] # Actions support a single host in this key
@edit[:new][subkey][:host][0] = params[:host_1] if params[:host_1] # Alerts support an array of hosts
@edit[:new][subkey][:host][1] = params[:host_2] if params[:host_2]
- Create a ticketCreate a ticket
Method explorer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def explorer
@explorer = true
@lastaction = "explorer"
@report_deleted = params[:report_deleted] == 'true' if params[:report_deleted]
@sb[:action] = nil
- Create a ticketCreate a ticket
Method st_set_record_vars
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def st_set_record_vars(st)
common_st_record_vars(st)
st.remove_all_resources
@add_rsc = true
unless @edit[:new][:selected_resources].empty?
- Create a ticketCreate a ticket
Method upload
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upload
assert_privileges("miq_report_export")
@sb[:flash_msg] = []
if params.fetch_path(:upload, :file) && File.size(params[:upload][:file].tempfile).zero?
- Create a ticketCreate a ticket
Method render_exception
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render_exception(msg, error)
respond_to do |format|
format.js do
render :update do |page|
page << javascript_prologue
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
const widgetUrl = (widgetId, widgetType) => {
const widgetTypeUrl = {
menu: '/dashboard/widget_menu_data/',
report: '/dashboard/widget_report_data/',
chart: '/dashboard/widget_chart_data/',
- 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 59.
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
Object.keys(data).forEach((key) => {
if (data[key].id === value) {
options = data[key].options;
}
});
- 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 59.
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
const widgetUrl = () => {
const widgetTypeUrl = {
menu: '/dashboard/widget_menu_data/',
report: '/dashboard/widget_report_data/',
chart: '/dashboard/widget_chart_data/',
- 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 59.
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
Object.keys(data).forEach((key) => {
if (data[key].id === value) {
options = data[key].options;
}
});
- 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 59.
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 3 locations. Consider refactoring. Open
MiqCustomTab.propTypes = {
containerId: PropTypes.string.isRequired,
tabLabels: PropTypes.arrayOf(PropTypes.string).isRequired,
type: PropTypes.string.isRequired,
};
- 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 59.
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 3 locations. Consider refactoring. Open
GenericGroup.propTypes = {
title: PropTypes.string.isRequired,
items: PropTypes.arrayOf(PropTypes.any).isRequired,
onClick: PropTypes.func.isRequired,
};
- 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 59.
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 3 locations. Consider refactoring. Open
MultilinkTable.propTypes = {
title: PropTypes.string.isRequired,
items: PropTypes.arrayOf(PropTypes.any).isRequired,
onClick: PropTypes.func.isRequired,
};
- 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 59.
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
useEffect(() => {
// The list of registered fields shows up after this render, so the validation has to happen
// with a delay and has to be pulled back via the state.
setTimeout(() => setState((state) => ({ ...state, depsValid: dv })));
formOptions.change(name, isValid);
- 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 59.
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