Showing 2,011 of 18,366 total issues
File mockdata.js
has 6111 lines of code (exceeds 400 allowed). Consider refactoring. Open
export const initalDataForFirstTestCase = {
"catalogFormId": "148",
"allCatalogs": [
[
"My Company/AWS",
- Create a ticketCreate a ticket
File routes.rb
has 3186 lines of code (exceeds 400 allowed). Consider refactoring. Open
Rails.application.routes.draw do
# rubocop:disable Layout/HashAlignment
# rubocop:disable Layout/MultilineOperationIndentation
# default routes for each controller
default_routes = %w[
- Create a ticketCreate a ticket
File miq_ae_class_controller.rb
has 2577 lines of code (exceeds 400 allowed). Consider refactoring. Open
require "rexml/document"
class MiqAeClassController < ApplicationController
include MiqAeClassHelper
include AutomateTreeHelper
include Mixins::GenericSessionMixin
- Create a ticketCreate a ticket
Method update_from_expression_editor
has a Cognitive Complexity of 271 (exceeds 5 allowed). Consider refactoring. Open
def update_from_expression_editor(params)
if params[:chosen_typ] && params[:chosen_typ] != exp_typ
change_exp_typ(params[:chosen_typ])
else
case exp_typ
- Read upRead up
- Create a ticketCreate a ticket
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
File catalog_controller.rb
has 2151 lines of code (exceeds 400 allowed). Consider refactoring. Open
class CatalogController < ApplicationController
include AutomateTreeHelper
include Mixins::ServiceDialogCreationMixin
include Mixins::BreadcrumbsMixin
include Mixins::AutomationMixin
- Create a ticketCreate a ticket
File compare.rb
has 1629 lines of code (exceeds 400 allowed). Consider refactoring. Open
module ApplicationController::Compare
extend ActiveSupport::Concern
DRIFT_TIME_COLUMNS = %w[last_scan_on boot_time last_logon].freeze
- Create a ticketCreate a ticket
File application_controller.rb
has 1525 lines of code (exceeds 400 allowed). Consider refactoring. Open
require 'open-uri'
class ApplicationController < ActionController::Base
include Vmdb::Logging
- Create a ticketCreate a ticket
File editor.rb
has 1488 lines of code (exceeds 400 allowed). Consider refactoring. Open
module ReportController::Reports::Editor
extend ActiveSupport::Concern
included do
helper_method :cashed_reporting_available_fields, :cashed_reporting_available_fields
- Create a ticketCreate a ticket
Class MiqAeClassController
has 166 methods (exceeds 20 allowed). Consider refactoring. Open
class MiqAeClassController < ApplicationController
include MiqAeClassHelper
include AutomateTreeHelper
include Mixins::GenericSessionMixin
include Mixins::BreadcrumbsMixin
- Create a ticketCreate a ticket
Method settings_get_form_vars
has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring. Open
def settings_get_form_vars
settings_load_edit
return unless @edit
@in_a_form = true
- Read upRead up
- Create a ticketCreate a ticket
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 replace_right_cell
has a Cognitive Complexity of 153 (exceeds 5 allowed). Consider refactoring. Open
def replace_right_cell(options = {})
@explorer = true
action = options[:action]
replace_trees = options[:replace_trees] || []
get_node_info unless @in_a_form
- Read upRead up
- Create a ticketCreate a ticket
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 ap_edit
has a Cognitive Complexity of 141 (exceeds 5 allowed). Consider refactoring. Open
def ap_edit
assert_privileges("ap_edit")
if params["accept"]
ap_accept_line_changes
else
- Read upRead up
- Create a ticketCreate a ticket
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
File miq_application.js
has 1216 lines of code (exceeds 400 allowed). Consider refactoring. Open
/* global add_flash getChartColumnDataValues getChartFormatedValue miqBrowserDetect miqExpressionPrefill miqFlashLater miqFlashSaved miqGridCheckAll miqGridGetCheckedRows miqMenu miqTreeObject miqValueStylePrefill recalculateChartYAxisLabels */
// MIQ specific JS functions
// Things to be done on page loads
- Create a ticketCreate a ticket
Method st_get_form_vars
has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring. Open
def st_get_form_vars
get_form_vars
if params[:resource_id]
# adding new service resource, so need to lookup actual vm or service template record and set defaults
sr = ServiceTemplate.find(params[:resource_id])
- Read upRead up
- Create a ticketCreate a ticket
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
File performance.rb
has 1202 lines of code (exceeds 400 allowed). Consider refactoring. Open
module ApplicationController::Performance
extend ActiveSupport::Concern
CHARTS_REPORTS_FOLDER = Rails.root.join("product", "charts", "miq_reports")
CHARTS_LAYOUTS_FOLDER = Rails.root.join("product", "charts", "layouts")
- Create a ticketCreate a ticket
Function createSchema
has 531 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createSchema(recordId, promise, inheritTags, evaluateAlert, tags, ansibleInventory, snapshotAge, parentType, inventoryType) {
const subForm = [
{
component: componentTypes.SUB_FORM,
id: 'subform-1',
- Create a ticketCreate a ticket
Class CatalogController
has 133 methods (exceeds 20 allowed). Consider refactoring. Open
class CatalogController < ApplicationController
include AutomateTreeHelper
include Mixins::ServiceDialogCreationMixin
include Mixins::BreadcrumbsMixin
include Mixins::AutomationMixin
- Create a ticketCreate a ticket
File ops_rbac.rb
has 1180 lines of code (exceeds 400 allowed). Consider refactoring. Open
module OpsController::OpsRbac
extend ActiveSupport::Concern
TAG_DB_TO_NAME = {
'MiqGroup' => 'group',
- Create a ticketCreate a ticket
File vm_common.rb
has 1172 lines of code (exceeds 400 allowed). Consider refactoring. Open
module VmCommon
extend ActiveSupport::Concern
include ActionView::Helpers::JavaScriptHelper
include Mixins::ChargebackPreviewMixin
include ProvisionCustomizeHelper
- Create a ticketCreate a ticket
File application_helper.rb
has 1152 lines of code (exceeds 400 allowed). Consider refactoring. Open
module ApplicationHelper
include ApplicationHelper::ViewsShared
include ApplicationHelper::Flash
include ApplicationHelper::Listnav
include ApplicationHelper::Navbar
- Create a ticketCreate a ticket