Showing 230 of 230 total issues
File foreman_remote_execution.js
has 1594 lines of code (exceeds 250 allowed). Consider refactoring. Open
locales['foreman_remote_execution'] = locales['foreman_remote_execution'] || {}; locales['foreman_remote_execution']['ja'] = {
"domain": "foreman_remote_execution",
"locale_data": {
"foreman_remote_execution": {
"": {
File job_invocation_composer.rb
has 535 lines of code (exceeds 250 allowed). Consider refactoring. Open
class JobInvocationComposer
class JobTemplateNotFound < StandardError; end
class FeatureNotFound < StandardError; end
File JobWizard.js
has 498 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable max-lines */
/* eslint-disable camelcase */
import React, { useState, useEffect, useCallback } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import PropTypes from 'prop-types';
File Schedule.test.js
has 419 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable max-lines */
import React from 'react';
import { Provider } from 'react-redux';
import configureMockStore from 'redux-mock-store';
import { fireEvent, screen, render, act } from '@testing-library/react';
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const SSHUserField = ({ value, setValue, defaultValue }) => (
<FormGroup
label={__('SSH user')}
labelIcon={helpLabel(__('A user to be used for SSH.'), 'ssh-user')}
fieldId="ssh-user"
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 155.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const EffectiveUserField = ({ value, setValue, defaultValue }) => (
<FormGroup
label={__('Effective user')}
labelIcon={helpLabel(
__(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 155.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
...(scheduleValue.scheduleType === SCHEDULE_TYPES.FUTURE
? [
{
name: SCHEDULE_TYPES.FUTURE,
component: (
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 150.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
...(scheduleValue.scheduleType === SCHEDULE_TYPES.RECURRING
? [
{
name: SCHEDULE_TYPES.RECURRING,
component: (
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 150.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Class JobInvocationComposer
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
class JobInvocationComposer
class JobTemplateNotFound < StandardError; end
class FeatureNotFound < StandardError; end
File AdvancedFields.test.js
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable max-lines */
import React from 'react';
import { Provider } from 'react-redux';
import { mount } from '@theforeman/test';
import { fireEvent, screen, render, act } from '@testing-library/react';
Function DateTimePicker
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
export const DateTimePicker = ({
dateTime,
setDateTime,
isDisabled,
ariaLabel,
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const KeyPassphraseField = ({ value, setValue }) => (
<FormGroup
label={__('Private key passphrase')}
labelIcon={helpLabel(
__(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 128.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const EffectiveUserPasswordField = ({ value, setValue }) => (
<FormGroup
label={__('Effective user password')}
labelIcon={helpLabel(
__(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 128.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function formatter
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const formatter = (input, values, setValue) => {
const isSelectType = !!input?.options;
const inputType = input.value_type;
const isTextType = inputType === 'plain' || !inputType; // null defaults to plain
File index.js
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable max-lines */
import React, { useEffect, useState } from 'react';
import {
Button,
DescriptionList,
Class RemoteExecutionProvider
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class RemoteExecutionProvider
EFFECTIVE_USER_METHODS = %w[sudo dzdo su].freeze
class << self
File fixtures.js
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable max-lines */
import configureMockStore from 'redux-mock-store';
import hostsQuery from '../steps/HostsAndInputs/hosts.gql';
import hostgroupsQuery from '../steps/HostsAndInputs/hostgroups.gql';
File engine.rb
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ForemanRemoteExecution
DYNFLOW_QUEUE = :remote_execution
class Engine < ::Rails::Engine
engine_name 'foreman_remote_execution'
Class JobInvocation
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class JobInvocation < ApplicationRecord
CACHE_PREFIX = "job_invocation".freeze
audited :except => [:task_id, :targeting_id, :task_group_id, :triggering_id]
Class RunHostsJob
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class RunHostsJob < Actions::ActionWithSubPlans
include Actions::RecurringAction
include Actions::ObservableAction
include Actions::RemoteExecution::EventHelpers