Showing 18,390 of 18,390 total issues
Function notificationReducer
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const notificationReducer = (state = notificationInitialState, action) => {
switch (action.type) {
case INIT_NOTIFICATIONS:
return {
...state,
- Create a ticketCreate a ticket
Method ab_button_add
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ab_button_add
assert_privileges("ab_button_new")
@sb[:active_tab] = "ab_options_tab"
@resolve = session[:resolve]
name = @edit[:new][:instance_name].presence || @edit[:new][:other_name]
- Create a ticketCreate a ticket
Method menu_update
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def menu_update
assert_privileges("miq_report_menu_editor")
menu_get_form_vars
# @changed = (@edit[:new] != @edit[:current])
- Create a ticketCreate a ticket
File quadicons.js
has 419 lines of code (exceeds 400 allowed). Consider refactoring. Open
export const quads = [
{
topLeft: {
fonticon: 'fa fa-cog',
color: '#0099cc',
- Create a ticketCreate a ticket
Similar blocks of code found in 3 locations. Consider refactoring. Open
recentServersConfig: {
chartId: 'recentServersChart',
tooltipFn: () => dailyTimeTooltip(),
units: __('Servers'),
point: { r: 1 },
- 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 84.
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
recentInstancesConfig: {
chartId: 'recentInstancesChart',
tooltipFn: () => dailyTimeTooltip(),
units: __('Instances'),
point: { r: 1 },
- 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 84.
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
recentImagesConfig: {
chartId: 'recentInstancesChart',
tooltipFn: () => dailyTimeTooltip(),
units: __('Images'),
point: { r: 1 },
- 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 84.
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
dailyNetworkUsageConfig: {
chartId: 'networkUsageDailyChart',
headTitle: __('Network Utilization Trend'),
timeFrame: __('Last 30 Days'),
units: __('KBps'),
- 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 84.
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
hourlyNetworkUsageConfig: {
chartId: 'networkUsageHourlyChart',
headTitle: __('Network Utilization Trend'),
timeFrame: __('Last 24 Hours'),
units: __('KBps'),
- 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 84.
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
API.get(`/api/vms/?filter[]=ems_id=${emsId}&expand=resources`)
.then(({ resources }) => resources.filter((vm) => vm.id !== `${recordId}`))
// Get valid VM Parent Options and format them for select component
.then((vmParentOptions) => vmParentOptions.forEach((vm) => {
parentOptions.push({ label: `${vm.name} -- ${vm.location}`, value: `${vm.id},${vm.template}` });
- 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 84.
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
Function onSubmit
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit = (values, formApi) => {
promise.then(async({ data: { allowed_association_types } }) => {
// check to determine whether to delete or replace existing custom image
if (values.file_upload) {
const fileList = get(values, formApi.fileInputs[0]).inputFiles;
- Create a ticketCreate a ticket
Function render
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const usedServicesMessage = (data) => {
let warningItems = [];
if (data.length === 1) { // We're deleting just one catalog item
const services = {};
- Create a ticketCreate a ticket
Method pre_prov
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pre_prov
assert_privileges("miq_request_edit")
if params[:button] == "cancel"
flash_to_session(_("Add of new %{type} Request was cancelled by the user") % {:type => session[:edit][:prov_type]})
@explorer = session[:edit][:explorer] || false
- Create a ticketCreate a ticket
Method miq_event_edit
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def miq_event_edit
assert_privileges("miq_policy_event_edit")
case params[:button]
when "cancel"
@edit = nil
- Create a ticketCreate a ticket
Method button
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def button
@edit = session[:edit] # Restore @edit for adv search box
params[:display] = @display if ["instances"].include?(@display) # Were we displaying vms/hosts/storages
params[:page] = @current_page if @current_page.nil? # Save current page for list refresh
- Create a ticketCreate a ticket
Method old_dialogs_update_create
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def old_dialogs_update_create
old_dialogs_get_form_vars
case params[:button]
when "cancel"
@edit = session[:edit] = nil # clean out the saved info
- Create a ticketCreate a ticket
Method add_field_to_col_order
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_field_to_col_order(rpt, field)
# Get the sort columns, removing the suffix if it exists
sortby1 = if MiqReport.is_break_suffix?(@edit[:new][:sortby1].split("__")[1])
@edit[:new][:sortby1].split("__").first
else
- Create a ticketCreate a ticket
Method check_tabs
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_tabs
@sb[:miq_tab] = params[:tab]
active_tab = 'edit_1'
case @sb[:miq_tab].split('_')[1]
when '8'
- Create a ticketCreate a ticket
Method schedule_get_form_vars
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def schedule_get_form_vars
@schedule = @edit[:sched_id] ? MiqSchedule.find(@edit[:sched_id]) : MiqSchedule.new(:userid => session[:userid])
copy_params_if_present(@edit[:new], params, %i[name description])
@edit[:new][:enabled] = (params[:enabled] == "1") if params[:enabled]
@edit[:new][:filter] = params[:filter_typ] if params[:filter_typ]
- Create a ticketCreate a ticket
Method for_render_default
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def for_render_default
data = {:explorer => 'replace_right_cell', :scrollTop => true}
if @options[:exp].present?
data.store_path(:expEditor, :first, :type, @options[:exp][:val1_type]) if @options[:exp][:val1_type]
- Create a ticketCreate a ticket