Showing 2,015 of 18,390 total issues
Method change_tab
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def change_tab(new_tab_id = nil)
assert_privileges(x_active_tree == :settings_tree ? "ops_settings" : "ops_diagnostics")
@explorer = true
params[:miq_grid_checks] = []
- Create a ticketCreate a ticket
Method ab_button_save
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ab_button_save
assert_privileges("ab_button_edit")
@resolve = session[:resolve]
attrs = {}
@sb[:active_tab] = "ab_options_tab"
- Create a ticketCreate a ticket
Method update_instance
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_instance
assert_privileges("miq_ae_instance_edit")
return unless load_edit("aeinst_edit__#{params[:id]}", "replace_cell__explorer")
get_instances_form_vars
- Create a ticketCreate a ticket
Method rbac_edit_save_or_add
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rbac_edit_save_or_add(what, rbac_suffix = what)
key = what.to_sym
id = params[:id] || "new"
add_pressed = params[:button] == "add"
- Create a ticketCreate a ticket
Method rsop
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rsop
assert_privileges('policy_simulation')
if params[:button] == "submit"
if params[:task_id] # First time thru, kick off the report generate task
miq_task = MiqTask.find(params[:task_id]) # Not first time, read the task record
- Create a ticketCreate a ticket
Method action_build_edit_screen
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def action_build_edit_screen
@edit = {}
@edit[:new] = {}
@edit[:current] = {}
- Create a ticketCreate a ticket
Method widget_set_record_vars
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def widget_set_record_vars(widget)
widget.title = @edit[:new][:title]
widget.description = @edit[:new][:description]
widget.enabled = @edit[:new][:enabled]
widget.options ||= {}
- Create a ticketCreate a ticket
Method widget_edit
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def widget_edit
assert_privileges("widget_edit")
case params[:button]
when "cancel"
- Create a ticketCreate a ticket
Function miq_tabs_init
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
window.miq_tabs_init = function(id, url, parms) {
$(`${id} > ul.nav-tabs a[data-toggle="tab"]`).on('show.bs.tab', (e) => {
if ($(e.target).parent().hasClass('disabled')) {
e.preventDefault();
return false;
- 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
Function miqBrowserDetect
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
window.miqBrowserDetect = function() {
var BrowserDetect = {
init: function() {
this.browser = this.searchString(this.dataBrowser) || 'An unknown browser';
this.version = this.searchVersion(navigator.userAgent) ||
- 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
Function createSchema
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const createSchema = (credentials, credentialReferences, payloadCredentials, workflowAuthentications, setState) => {
// Saves a new credential mapping to 'credentials'
const mapCredentials = () => setState((state) => {
if (state.workflowCredentials && state.credentialField) {
return ({
- 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
Function createSchema
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const createSchema = (credentials, credentialReferences, payloadCredentials, workflowAuthentications, setState) => {
// Saves a new credential mapping to 'credentials'
const mapCredentials = () => setState((state) => {
if (state.workflowCredentials && state.credentialField) {
return ({
- 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
Function NotificationDrawer
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const NotificationDrawer = ({ jsRequest }) => {
const dispatch = useDispatch();
const drawerTitle = __('Notifications');
const [isDrawerExpanded, setDrawerExpanded] = useState(false);
const {
- 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
Function NetworkSecurityGroupsForm
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const NetworkSecurityGroupsForm = ({ securityGroupId }) => {
const [{
initialValues, isLoading, fields, subnets,
}, setState] = useState({
isLoading: !!securityGroupId, fields: [], subnetSelect: [], subnets: [],
- 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
Function AnsiblePlayBookEditCatalogForm
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const AnsiblePlayBookEditCatalogForm = ({ initialData }) => {
const [data, setData] = useState({
isLoading: true,
formData: {},
currencies: [],
- 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
Function AttachDetachCloudVolumeForm
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const AttachDetachCloudVolumeForm = ({ recordId, isAttach, dropdownChoices, dropdownLabel }) => {
const [{ isLoading, fields }, setState] = useState({ isLoading: true, fields: [] });
const loadSchema = (appendState = {}) => ({ data: { form_schema: { fields } } }) => {
setState((state) => ({
- 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 report_schedule_summary
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def report_schedule_summary(schedule, email_to, rep_filter, timezone)
data = {:title => _('Schedule Info'), :mode => "miq_report_schedule_info"}
rows = []
rows.push(row_data(_('Description'), schedule.description))
rows.push(row_data(_('Active'), _(schedule.enabled.to_s.capitalize)))
- 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
Function StorageServiceForm
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const StorageServiceForm = ({ recordId, storageManagerId }) => {
const [{ fields, initialValues, isLoading }, setState] = useState({
fields: [], isLoading: !!recordId || !!storageManagerId,
});
const submitLabel = !!recordId ? __('Save') : __('Add');
- 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
Function PhysicalStorageForm
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const PhysicalStorageForm = ({ recordId, storageManagerId }) => {
const [state, setState] = useState({});
const { isLoading, initialValues } = state;
const [familyId, setFamilyId] = useState(undefined);
const submitLabel = !!recordId ? __('Save') : __('Add');
- 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
Function render
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
render() {
const usedServicesMessage = (data) => {
let warningItems = [];
if (data.length === 1) { // We're deleting just one catalog item
const services = {};
- 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"