Showing 2,015 of 18,390 total issues
Function miqTreeScrollToNode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
window.miqTreeScrollToNode = function(tree, id) {
var node = miqTreeFindNodeByKey(tree, id);
var parentPanelBody = node.$el.parents('div.panel-body');
if (parentPanelBody.length > 0) {
// Calculate the current node position relative to the scrollable panel
- 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 logError
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
window.logError = function(fn) {
return function(text) {
try {
return fn(text);
} catch (ex) {
- 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 loadTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const loadTable = (values, tz, users) => {
const filters = [];
const {
zone, timePeriod, taskStatus, taskState, user,
} = values; // User selected values
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
window.miqBuildChartMenu = function(col, row, _value, category, series, id, _message) {
const set = id.split('_')[1]; // Get the chart set
const idx = id.split('_')[2]; // Get the chart index
const chart_data = ManageIQ.charts.chartData[set];
const chart_el_id = id.replace(/^miq_/, 'miq_chart_');
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
const createSchema = (fields, edit, ems, loadSchema, emptySchema) => {
const idx = fields.findIndex((field) => field.name === 'required_capabilities');
const supports = edit ? 'supports_storage_services' : 'supports_storage_service_create';
let providerCapabilities;
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
const createSchema = (fields, edit, ems, loadSchema, emptySchema) => {
const idx = fields.findIndex((field) => field.name === 'volume_type');
const supports = edit ? 'supports_cloud_volume' : 'supports_cloud_volume_create';
let providerCapabilities;
- 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 recalculateChartYAxisLabels
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
window.recalculateChartYAxisLabels = function(id) {
// hide/show chart with id
this.api.toggle(id);
var minMax = getMinMaxFromChart(this);
- 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 ServersDataChart
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ServersDataChart = ({
providerId, serversAvailableConfig, serversHealthConfig, title, apiUrl,
}) => {
const [data, setCardData] = useState({ loading: 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
Function ReportDataTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ReportDataTable = (props) => {
const { perPageDefault, perPageOptions, reportType } = props;
const initState = {
...initialState,
pagination: {
- 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 PasswordField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const PasswordField = ({
cancelEditLabel,
changeEditLabel,
helperText,
edit,
- 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 generateRefreshOptions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const generateRefreshOptions = (constrained = false, initialStep = 50, initialIndex = 200) => {
let index = initialIndex;
let step = initialStep;
const options = [];
while (index < 1000) {
- 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 wait_for_task
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
API.wait_for_task = (taskId) => {
const deferred = miqDeferred();
const retry = () => {
API.get(`/api/tasks/${taskId}?attributes=task_results`)
- 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 getPodsTrendChart
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getPodsTrendChart = (isLoading, dashboardData) => {
if (isLoading !== true) {
if (dashboardData.data.pod_metrics.dataAvailable) {
const tooltipType = dashboardData.data.pod_metrics.interval_name;
let config = 'hourlyPodUsageConfig';
- 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 MultiSelectWithSelectAll
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MultiSelectWithSelectAll = (props) => {
const {
initialValues, options, id, titleText, label, placeholder,
...rest
} = useFieldApi(prepareProps(props));
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
const createSchema = (state, setState, ems, initialValues, storageId, setStorageId, volumeId, setVolumeId) => {
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 InterfacesForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const InterfacesForm = ({ interfaces, add, routerId }) => {
const [{ initialValues, isLoading }, setState] = useState({ isLoading: !!routerId });
const onSubmit = (values) => {
if (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 EditPasswordField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const EditPasswordField = ({ componentClass, ...props }) => {
const {
labelText, validateOnMount, isDisabled, editMode, setEditMode, buttonLabel, input, meta, ...rest
} = useFieldApi(prepareProps(props));
- 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 SearchBar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const SearchBar = ({ searchText, advancedSearch, action }) => {
const formToken = () => {
const csrfToken = document.querySelector('meta[name=csrf-token]');
return csrfToken ? csrfToken.getAttribute('content') : '';
};
- 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 processOptions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function processOptions(options) {
const o = Object.assign({}, options);
delete o.body;
delete o.data;
- 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 getParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getParams = (urlParms, sendChecked) => {
const params = [];
if (urlParms && (urlParms[0] === '?')) {
params.push(urlParms.slice(1));
- 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"