Showing 18,390 of 18,390 total issues
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"
Further reading
Avoid deeply nested control flow statements. Open
if (rule.host_protocol === undefined) {
rule.host_protocol = null;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (rule.source_security_group_id === undefined || rule.source_security_group_id === null) {
rule.source_security_group_id = null;
} else {
rule.source_ip_range = '';
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (rule.network_protocol === undefined) {
rule.network_protocol = null;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (values.selectedItems[i].value !== 'all') {
tempItems.push(values.selectedItems[i]);
}
- Create a ticketCreate a ticket
Function setDiskFormSubmit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const setDiskFormSubmit = (data, setData, formData, roles, renderData) => {
const dataTableData = data.dataTable.disks || [];
if (data.form.action === 'add') {
// code for add
const id = `disk${dataTableData.length}`;
- 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 HostInitiatorGroupForm
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const HostInitiatorGroupForm = ({ recordId, storageManagerId }) => {
const [state, setState] = useState({});
const { isLoading, initialValues } = state;
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 formatSetData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const formatSetData = (setData, buttonIcon, appliesToClass, appliesToId, groupIndex) => {
if (appliesToId) {
return ({
...setData,
button_color: (setData && setData.button_color) ? setData.button_color : '#000',
- 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 getInitialValues
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getInitialValues = (ownershipItems) => new Promise((resolve) => {
if (ownershipItems.length > 1) {
resolve({ group: 'dont-change', user: 'dont-change' });
} else if (ownershipItems.length === 1) {
const item = ownershipItems[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
Function prepareRequestObject
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const prepareRequestObject = (values, formId) => {
const requestObject = { ...values };
// if price property is not there add price property if its present convert the value into string
if (!Object.prototype.hasOwnProperty.call(requestObject, 'price')) {
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
const createSchema = (state, setState, ems, initialValues, storageId, setStorageId) => {
let emsId = state.ems_id;
if (initialValues && initialValues.ems_id) {
emsId = initialValues.ems_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
Function notificationReducer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const notificationReducer = (state = notificationInitialState, action) => {
switch (action.type) {
case INIT_NOTIFICATIONS:
return {
...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
Function dataHelper
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const dataHelper = (values, timeProfileId, action, userid) => {
let data = {};
let APIaction = 'edit';
let metrics = values.rollup_daily_metrics;
let profileType = values.profile_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 model
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const model = (isLoading, widgetId, widgetModel, widgetType) => {
let widget;
if (isLoading) {
widget = (
<div className="loadingSpinner">
- 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"