Showing 722 of 1,271 total issues
Method define_host_params
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def define_host_params(host)
host_params = {
"enable-epel" => "true",
"package_upgrade" => "true",
"ansible_tower_provisioning" => "true",
Function schedulerHintFilterSelected
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function schedulerHintFilterSelected(item) {
const filter = $(item).val();
if (filter === '') {
$('#scheduler_hint_wrapper').empty();
Function pxeLoaderCompatibilityCheck
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pxeLoaderCompatibilityCheck() {
var pxeLoader = $('#host_pxe_loader').val();
var osTitle = $('#host_operatingsystem_id option:selected').text();
var compatible = tfm.hosts.checkPXELoaderCompatibility(osTitle, pxeLoader);
if (compatible === false) {
Function override_param
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function override_param(item) {
var param = $(item)
.closest('tr')
.addClass('override-param');
var n = param.find('[id^=name_]').text();
Method get_overview
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_overview(report, options = {})
options[:origin] = nil if options[:origin] == 'All'
state_labels = {
active_hosts_ok_enabled: _('Active'),
Method audited_icon
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def audited_icon(audit)
style = 'label-info'
if main_object? audit
style = case audit.action
when 'create'
Method install_packages
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def install_packages(packages)
return '' if packages.blank?
banner = <<~CMD
echo '#'
Method settings_map
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def settings_map
{
'FOREMAN_REQUIRE_SSL' => [:boolean, :require_ssl],
'FOREMAN_SUPPORT_JSONP' => [:boolean, :support_jsonp],
'FOREMAN_MARK_TRANSLATED' => [:boolean, :mark_translated],
Function update_form
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function update_form(element, options) {
options = options || {};
var url = $(element).data('url');
var data = serializeForm().replace('method=patch', 'method=post');
if (options.data) data = data + options.data;
- 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 RepositoryModal
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const RepositoryModal = ({
repoData,
handleRepoData,
isLoading,
isModalOpen,
- 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 FiltersForm
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const FiltersForm = ({ roleName, roleId, isNew, data, history }) => {
const [role, setRole] = useState(roleId);
const [type, setType] = useState(EMPTY_RESOURCE_TYPE);
const [chosenPermissions, setChosenPermissions] = useState([]);
const [isUnlimited, setIsUnlimited] = useState(!!data['unlimited?']);
- 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 getAreaChartConfig
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const getAreaChartConfig = ({
data,
config = 'timeseries',
onclick,
yAxisLabel,
- 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 RegistrationCommandsPage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const RegistrationCommandsPage = () => {
const dispatch = useDispatch();
// Context
const currentOrganization = useForemanOrganization();
- 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 render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
data: {
name,
isSafemodeEnabled,
- 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 formatArraySelection
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const formatArraySelection = (attr, setting) => {
const selectValues = arraySelection(setting);
if (!setting[attr] || !selectValues) {
return null;
- 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 Controller
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Controller = ({
addDiskEnabled,
addDisk,
removeDisk,
updateController,
- 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
Method queue_tftp_update
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def queue_tftp_update
set_tftp = false
# we switched build mode
set_tftp = true if old.host.build? != host.build?
# medium or arch changed
- 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
Method export_iterable
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def export_iterable(items, include_blank)
if items.is_a?(Hash)
items.each { |key, value| items[key] = value.respond_to?(:to_export) ? value.to_export(include_blank) : value }
items.to_hash.stringify_keys
else
- 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
Method resolve
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def resolve(args)
includes = [:domains]
includes << { taxable_taxonomies: :taxonomy } if args[:location]
scope = lambda do |scope|
- 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
Method complete_value_from_db
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def complete_value_from_db(field, val)
count = 20
case field.field
when :name
results = @registry.filter_map { |set| ((set.full_name =~ /\s/) ? "\"#{set.full_name.gsub('"', '\"')}\"" : set.full_name) if set.name.include?(val) || set.full_name&.include?(val) }
- 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"