ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,420 of 18,420 total issues

File mockdata.js has 6111 lines of code (exceeds 400 allowed). Consider refactoring.
Open

export const initalDataForFirstTestCase = {
"catalogFormId": "148",
"allCatalogs": [
[
"My Company/AWS",
Severity: Major
Found in app/javascript/spec/ansible-edit-catalog-form/mockdata.js - About 2 wks to fix

File routes.rb has 3192 lines of code (exceeds 400 allowed). Consider refactoring.
Open

Rails.application.routes.draw do
# rubocop:disable Layout/HashAlignment
# rubocop:disable Layout/MultilineOperationIndentation
# default routes for each controller
default_routes = %w[
Severity: Major
Found in config/routes.rb - About 1 wk to fix

File miq_ae_class_controller.rb has 2636 lines of code (exceeds 400 allowed). Consider refactoring.
Open

require "rexml/document"
class MiqAeClassController < ApplicationController
include MiqAeClassHelper
include AutomateTreeHelper
include Mixins::GenericSessionMixin
Severity: Major
Found in app/controllers/miq_ae_class_controller.rb - About 6 days to fix

Similar blocks of code found in 3 locations. Consider refactoring.
Open

const AnsibleRepositoryForm = ({ repositoryId }) => {
const [{
initialValues, isLoading, provider,
}, setState] = useState({
isLoading: true,
Severity: Major
Found in app/javascript/components/ansible-repository-form/index.jsx and 2 other locations - About 5 days to fix
app/javascript/components/embedded-terraform-repository-form/index.jsx on lines 9..116
app/javascript/components/workflow-repository-form/index.jsx on lines 9..116

Similar blocks of code found in 3 locations. Consider refactoring.
Open

const EmbeddedTerraformRepositoryForm = ({ repositoryId }) => {
const [{
initialValues, isLoading, provider,
}, setState] = useState({
isLoading: true,
app/javascript/components/ansible-repository-form/index.jsx on lines 9..116
app/javascript/components/workflow-repository-form/index.jsx on lines 9..116

Similar blocks of code found in 3 locations. Consider refactoring.
Open

const WorkflowRepositoryForm = ({ repositoryId }) => {
const [{
initialValues, isLoading, provider,
}, setState] = useState({
isLoading: true,
Severity: Major
Found in app/javascript/components/workflow-repository-form/index.jsx and 2 other locations - About 5 days to fix
app/javascript/components/ansible-repository-form/index.jsx on lines 9..116
app/javascript/components/embedded-terraform-repository-form/index.jsx on lines 9..116

Method update_from_expression_editor has a Cognitive Complexity of 271 (exceeds 5 allowed). Consider refactoring.
Open

def update_from_expression_editor(params)
if params[:chosen_typ] && params[:chosen_typ] != exp_typ
change_exp_typ(params[:chosen_typ])
else
case exp_typ
Severity: Minor
Found in app/controllers/application_controller/filter/expression.rb - About 5 days to fix

File catalog_controller.rb has 2149 lines of code (exceeds 400 allowed). Consider refactoring.
Open

class CatalogController < ApplicationController
include AutomateTreeHelper
include Mixins::ServiceDialogCreationMixin
include Mixins::BreadcrumbsMixin
include Mixins::AutomationMixin
Severity: Major
Found in app/controllers/catalog_controller.rb - About 5 days to fix

File compare.rb has 1629 lines of code (exceeds 400 allowed). Consider refactoring.
Open

module ApplicationController::Compare
extend ActiveSupport::Concern
 
DRIFT_TIME_COLUMNS = %w[last_scan_on boot_time last_logon].freeze
 
 
Severity: Major
Found in app/controllers/application_controller/compare.rb - About 3 days to fix

Identical blocks of code found in 2 locations. Consider refactoring.
Open

"sb": {
"action": "catalogitem_edit",
"trees": {
"svccat_tree": {
"tree": "svccat_tree",
Severity: Major
Found in app/javascript/spec/ansible-edit-catalog-form/mockdata.js and 1 other location - About 3 days to fix
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 489..771

Identical blocks of code found in 2 locations. Consider refactoring.
Open

"sb": {
"action": "catalogitem_edit",
"trees": {
"svccat_tree": {
"tree": "svccat_tree",
Severity: Major
Found in app/javascript/spec/ansible-edit-catalog-form/mockdata.js and 1 other location - About 3 days to fix
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 773..1055

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const EmbeddedTerraformCredentialsForm = ({ recordId }) => {
const [{ fields, initialValues, isLoading }, setState] = useState({ fields: [], isLoading: !!recordId });
const promise = useMemo(() => API.options('/api/authentications'), []);
const submitLabel = !!recordId ? __('Save') : __('Add');
 
 
app/javascript/components/workflow-credentials-form/index.jsx on lines 9..86

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const WorkflowCredentialsForm = ({ recordId }) => {
const [{ fields, initialValues, isLoading }, setState] = useState({ fields: [], isLoading: !!recordId });
const promise = useMemo(() => API.options('/api/authentications'), []);
const submitLabel = !!recordId ? __('Save') : __('Add');
 
 
Severity: Major
Found in app/javascript/components/workflow-credentials-form/index.jsx and 1 other location - About 3 days to fix
app/javascript/components/embedded-terraform-credentials-form/index.jsx on lines 9..86

File application_controller.rb has 1525 lines of code (exceeds 400 allowed). Consider refactoring.
Open

require 'open-uri'
 
class ApplicationController < ActionController::Base
include Vmdb::Logging
 
 
Severity: Major
Found in app/controllers/application_controller.rb - About 3 days to fix

File editor.rb has 1488 lines of code (exceeds 400 allowed). Consider refactoring.
Open

module ReportController::Reports::Editor
extend ActiveSupport::Concern
 
included do
helper_method :cashed_reporting_available_fields, :cashed_reporting_available_fields
Severity: Major
Found in app/controllers/report_controller/reports/editor.rb - About 3 days to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const KeyValueListComponent = (props) => {
const {
input, label, keyLabel, valueLabel,
} = useFieldApi(props);
const formOptions = useFormApi();
app/javascript/components/ansible-playbook-edit-catalog-form/helper.js on lines 157..212

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const KeyValueListComponent = (props) => {
const {
input, label, keyLabel, valueLabel,
} = useFieldApi(props);
const formOptions = useFormApi();
app/javascript/components/terraform-template-catalog-form/helper.js on lines 158..213

Class MiqAeClassController has 169 methods (exceeds 20 allowed). Consider refactoring.
Open

class MiqAeClassController < ApplicationController
include MiqAeClassHelper
include AutomateTreeHelper
include Mixins::GenericSessionMixin
include Mixins::BreadcrumbsMixin
Severity: Major
Found in app/controllers/miq_ae_class_controller.rb - About 3 days to fix

Method settings_get_form_vars has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
Open

def settings_get_form_vars
settings_load_edit
return unless @edit
 
@in_a_form = true
Severity: Minor
Found in app/controllers/ops_controller/settings/common.rb - About 3 days to fix

Method replace_right_cell has a Cognitive Complexity of 153 (exceeds 5 allowed). Consider refactoring.
Open

def replace_right_cell(options = {})
@explorer = true
action = options[:action]
replace_trees = options[:replace_trees] || []
get_node_info unless @in_a_form
Severity: Minor
Found in app/controllers/report_controller.rb - About 3 days to fix
Severity
Category
Status
Source
Language