Showing 722 of 1,271 total issues
Consider simplifying this complex logical expression. Open
if os_name == 'Debian' &&
(facts[:ansible_distribution_major_version][%r{/sid}i] ||
facts[:ansible_distribution_major_version] == 'n/a')
debian_os_major_sid
else
Method selectable_f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def selectable_f(f, attr, array, select_options = {}, html_options = {})
Method selectable_f_inline
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def selectable_f_inline(f, attr, array, select_options = {}, html_options = {})
Method time_zone_select_f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def time_zone_select_f(f, attr, default_timezone, select_options = {}, html_options = {})
Method form_select_f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def form_select_f(f, attr, array, select_options = {}, html_options = {})
Method checkbox_f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def checkbox_f(f, attr, options = {}, checked_value = "1", unchecked_value = "0")
Method link_to_add_fields
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def link_to_add_fields(name, f, association, partial = nil, options = {})
Method orderable_select_f
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def orderable_select_f(f, attr, choices, select_options = {}, html_options = {})
Function update_capabilities
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function update_capabilities(capabilities) {
capabilities = capabilities.split(' ');
$('#image_provisioning').empty();
$('#image_selection').appendTo($('#image_provisioning'));
update_provisioning_image();
- Read upRead up
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 CardTemplate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CardTemplate = ({
header,
children,
expandable,
dropdownItems,
- Read upRead up
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 CardExpansionContextWrapper
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const CardExpansionContextWrapper = ({ children }) => {
const [cardExpandStates, dispatch] = useReducer(cardExpansionReducer, {});
// On mount, get values from localStorage and set them in state
const initializeCardFromLocalStorage = useCallback(key => {
const value = localStorage.getItem(`${key} card expanded`);
- Read upRead up
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 ConfirmModal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ConfirmModal = () => {
const {
id,
isOpen,
title,
- Read upRead up
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 interface_domain_selected
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function interface_domain_selected(element) {
// mark the selected value to preserve it for form hiding
preserve_selected_options($(element));
var domain_id = element.value;
- Read upRead up
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 EditorModal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const EditorModal = ({
changeDiffViewType,
changeEditorValue,
diffViewType,
editorValue,
- Read upRead up
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 nic_info
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function nic_info(form) {
var info = '';
var virtual_types = ['Nic::Bond', 'Nic::Bridge'];
if (
form.find('.virtual').is(':checked') ||
- Read upRead up
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 subnetMaskChanged
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function subnetMaskChanged(field) {
var mask = field.val();
var cidr_field = $('#subnet_cidr');
clearError(field);
if (isBlank(mask)) {
- Read upRead up
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 instanceTypeSelected
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function instanceTypeSelected(item) {
const instanceType = $(item).val();
if (!item.disabled) {
const url = $(item).attr('data-url');
- Read upRead up
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 SettingValueField
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const SettingValueField = ({ setting, form, field }) => {
const { selectValues } = setting;
const cssClasses = classNames({ 'masked-input': setting.encrypted });
let inputField = <FormControl {...field} className={cssClasses} />;
- Read upRead up
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 fix_template_context
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function fix_template_context(content, context) {
// context will be something like this for a brand new form:
// project[tasks_attributes][new_1255929127459][assignments_attributes][new_1255929128105]
// or for an edit form:
// project[tasks_attributes][0][assignments_attributes][1]
- Read upRead up
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 deleteHost
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const deleteHost = (
hostName,
compute,
destroyVmOnHostDelete
) => dispatch => {
- Read upRead up
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"