Showing 2,015 of 18,390 total issues
Method quota
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def quota
@project.container_quota_items.collect do |quota_item|
enforced = quota_item.quota_enforced
observed = quota_item.quota_observed
enforced = (enforced % 1).zero? ? enforced.to_i : enforced
- 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 servers_group
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def servers_group
# Get recent Servers
all_servers = Hash.new(0)
servers_with_host = Hash.new(0)
valid_servers = Hash.new(0)
- 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 merge_sections
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def merge_sections(sections)
sections.each do |section|
position = nil
parent = if section.parent_id && @id_to_section.key?(section.parent_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
Method x_get_tree_roots
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def x_get_tree_roots
obj = if @assign_to.blank? || @assign_to == "enterprise"
[]
elsif @cat_tree
@cat ? Classification.find(@cat).entries : []
- 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 miqBuildChartMenu
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
window.miqBuildChartMenu = function(col, row, _value, category, series, id, _message) {
- Create a ticketCreate a ticket
Function miqBuildChartMenuEx
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
window.miqBuildChartMenuEx = function(col, row, _value, category, series, chart_set, chart_index) {
- Create a ticketCreate a ticket
Function miqChartLinkData
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
window.miqChartLinkData = function(col, row, value, category, series, id, message) {
- Create a ticketCreate a ticket
Function createSchema
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function createSchema(fieldss, recordId, emsId, mode, loadSchema, alertState, alertOptions) {
- Create a ticketCreate a ticket
Method _build_whatever_grid
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _build_whatever_grid(what, list, headers, sort_order, sort_by, integer_fields = [], state = @edit)
- Create a ticketCreate a ticket
Function chartData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
window.chartData = function(type, data, data2) {
if (type === undefined) {
return emptyChart();
}
- 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
Avoid deeply nested control flow statements. Open
if (rule.end_port === undefined) {
rule.end_port = null;
}
- Create a ticketCreate a ticket
Function reportSortDirection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const reportSortDirection = (sortKey, sortingColumns) => {
if (sortingColumns && sortingColumns[sortKey]) {
const { direction } = sortingColumns[sortKey];
if (direction === ReportSortDirections.DEFAULT) return ReportSortDirections.DESC;
if (direction === ReportSortDirections.ASC) return ReportSortDirections.DESC;
- 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 dataHelper
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const dataHelper = (values) => {
const vd = values.description;
const vt = values.action_type;
const optionValue = values.options ? values.options : {};
delete values.action_type;
- 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 validateMinMax
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
window.validateMinMax = function(min, max, minShowed, maxShowed) {
var invalid = false;
// if there are no valid values or there is only single values big enough, then not change formating function
if (max <= min || maxShowed < minShowed) {
if (max < min || max > 10) {
- 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
Avoid deeply nested control flow statements. Open
if (rule.port === undefined) {
rule.port = null;
}
- Create a ticketCreate a ticket
Function miqBuildChartMenuEx
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
window.miqBuildChartMenuEx = function(col, row, _value, category, series, chart_set, chart_index) {
const chart_data = ManageIQ.charts.chartData[chart_set];
const chart_el = $(`#miq_chart_parent_${chart_set}_${chart_index}`);
const chartmenu_el = $(`#miq_chartmenu_${chart_set}_${chart_index}`);
chartmenu_el.empty();
- 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
Avoid deeply nested control flow statements. Open
if (rule.direction === undefined) {
rule.direction = null;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (rule.source_ip_range === undefined) {
rule.source_ip_range = null;
}
- Create a ticketCreate a ticket
Function customJsAction
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const customJsAction = ({ action }) => {
switch (action.name) {
case 'miqTreeActivateNode':
if (action.nodeTree && action.nodeKey) {
window.miqTreeActivateNode(action.nodeTree, action.nodeKey);
- 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 add_flash
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
window.add_flash = function(msg, level, options) {
level = level || 'success';
options = options || {};
var cls = { alert: '', icon: '' };
- 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"