Showing 2,015 of 18,390 total issues
Method condition_build_edit_screen
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def condition_build_edit_screen
@edit = {}
@edit[:new] = {}
@edit[:current] = {}
- Create a ticketCreate a ticket
Method post_check
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_check(tree)
stack = tree.map(&:itself)
nodes = []
parents = []
- Create a ticketCreate a ticket
Function aeMethodFormController
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function aeMethodFormController($http, $scope, aeMethodFormId, currentRegion, miqService, playbookReusableCodeMixin, location, API) {
- Create a ticketCreate a ticket
Method initialize
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(typ = nil, months = 1, weeks = 1, days = 1, hours = 1, start_date = nil, start_hour = '00',
start_min = '00')
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if @edit && @edit[:expression] &&
(default_search?(search.name) && expression_selected_nil_or_id(search.id) ||
(@edit[:expression][:selected].nil? && search.id.to_i.zero? ||
expression_selected_id_or_name(:name, search.name)))
'active'
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
unless session[:view] && # A view exists and
session[:view].db.downcase == dbname && # the DB matches and
params[:refresh] != "y" && # refresh not being forced and
(
params[:ppsetting] || params[:page] || # changed paging or
- Create a ticketCreate a ticket
Function miqSparkleOn
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
window.miqSparkleOn = function() {
if (miqDomElementExists('advsearchModal')
&& ($('#advsearchModal').hasClass('modal fade in'))) {
if (miqDomElementExists('searching_spinner_center')) {
miqSearchSpinner(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 setVisibility
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
ManageIQ.explorer.setVisibility = function(data) {
if (_.isObject(data.setVisibility)) {
_.forEach(data.setVisibility, function(visible, element) {
if ( miqDomElementExists(element) ) {
if ( visible ) {
- 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 miqMenuChangeRow
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
window.miqMenuChangeRow = function(action, elem) {
var grid = $('#folder_grid .panel-group');
var selected = grid.find('.panel-heading.active').parent();
switch (action) {
- 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 recalculatePrecision
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
window.recalculatePrecision = function(minShowed, maxShowed, format, min, max) {
var changed = false;
if (maxShowed - minShowed <= Math.pow(10, 1 - format.options.precision)) {
// if min and max are close, labels should be more precise
changed = 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 miqTreeClearState
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
window.miqTreeClearState = function(tree) {
if (tree === undefined) {
// Clear all tree state objects
var to_remove = [];
for (var i = 0; i < sessionStorage.length; i++) {
- 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 OpsTenantForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const OpsTenantForm = ({
recordId,
divisible,
redirectUrl,
ancestry,
- 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 PxeImageForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const PxeImageForm = ({ recordId }) => {
const [{ initialValues, isLoading }, setState] = useState({ isLoading: !!recordId });
const submitLabel = !!recordId ? __('Save') : __('Add');
useEffect(() => {
- 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 ActionForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ActionForm = ({
recordId, inheritTags, availableAlerts, tags, ansibleInventory, snapshotAge, parentType, inventoryType,
}) => {
const [{ initialValues, isLoading }, setState] = useState({
isLoading: !!recordId,
- 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 PolicyProfileForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const PolicyProfileForm = ({ recordId }) => {
const [{ isLoading, options, initialValues }, setState] = useState({ isLoading: !!recordId });
const addDescription = (string1, string2) => `${string1} : ${string2}`;
useEffect(() => {
- 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 HostEditForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const HostEditForm = ({ ids }) => {
const [{
initialValues, isLoading, fields,
}, setState] = useState({
isLoading: (ids.length <= 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"
Further reading
Function ReportChartWidget
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ReportChartWidget = ({ data, id }) => {
if (data.miqChart === 'Area') {
return (<AreaChartGraph data={sampleData} />);
}
if (data.miqChart === 'Bar') {
- 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 TreeViewSelector
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const TreeViewSelector = ({
loadData,
lazyLoadData,
identifier,
isClearable,
- 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 AddRemoveSecurityGroupForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const AddRemoveSecurityGroupForm = ({
recordId, redirectURL, isAdd,
}) => {
const [{
isLoading, securityGroups,
- 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 miq_accordion_panel
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def miq_accordion_panel(title, condition, id, &block)
id = valid_html_id(id)
control_id = "control_#{id}"
content_tag(:div, :class => "panel panel-default") do
out = content_tag(:div, :class => "panel-heading", 'role' => 'tab', 'tabindex' => 0, :id => control_id) do
- 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"