Showing 33 of 105 total issues
Function AnsibleRoleInputs
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AnsibleRoleInputs = props => {
const { role, idx, resourceName } = props;
const fieldName = attr =>
`${resourceName}[${resourceName}_ansible_roles_attributes][${idx}][${attr}]`;
Function AnsibleRole
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const AnsibleRole = ({ role, icon, onClick, resourceName, index }) => {
const text =
resourceName === 'hostgroup'
? __('This Ansible role is inherited from parent host group')
: __('This Ansible role is inherited from host group');
- 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 onCompleted
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const onCompleted = (
dataPath,
onValidationError,
toggleWorking,
onSubmitSuccess
- 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 advancedMockFactory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const advancedMockFactory = query => (
variables,
data,
{ errors = [], currentUser = null, refetchData = 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
Method import_playbooks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def import_playbooks(playbooks_names)
playbooks = playbooks(playbooks_names)
result = { created: {}, updated: {} }
playbooks.each do |playbook|
parsed_playbook = parse_playbook playbook
- 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
Avoid too many return
statements within this function. Open
return wrapper(<Component {...rest} {...renamedData} />);
Avoid too many return
statements within this function. Open
return 'custom';
Avoid too many return
statements within this function. Open
return emptyWrapper(
<EmptyState
{...{
...defaultEmptyStateProps,
...allowPrimaryAction(
Function EditableAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const EditableAction = ({
onValidationError,
toggleWorking,
onSubmitSuccess,
open,
- 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 ansible_module_message
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ansible_module_message(log)
msg_json = parsed_message_json(log)
return _("Execution error: #{msg_json['msg']}") if msg_json['failed'].present?
return msg_json['censored'] if msg_json['censored'].present?
- 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 ansibleRoles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ansibleRoles = (state = initialState, action) => {
const { payload } = action;
switch (action.type) {
case ANSIBLE_ROLES_REQUEST:
- 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 import_variables
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def import_variables(role_variables, new_roles)
detect_changes(role_variables.map do |role_name, variables|
next if variables.blank?
role = import_new_role(role_name, new_roles)
next if role.blank?
- 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 partial_hostname_match
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def partial_hostname_match(hostname)
return @host unless @host.new_record?
hosts = Host.where(Host.arel_table[:name].matches("#{hostname}.%"))
if hosts.count > 1
msg = "More than 1 host found for name #{hostname}, "
- 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"