ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Method status has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def status
    routes_count = if @ems.present?
                     @ems.respond_to?(:container_routes) ? @ems.container_routes.count : 0 # ems might not have routes
                   else
                     ContainerRoute.count
Severity: Major
Found in app/services/container_dashboard_service.rb - About 2 hrs to fix

File textual_summary.rb has 408 lines of code (exceeds 400 allowed). Consider refactoring.
Open

module HostHelper::TextualSummary
  include TextualMixins::TextualCustomButtonEvents
  include TextualMixins::TextualDevices
  include TextualMixins::TextualOsInfo
  include TextualMixins::TextualVmmInfo
Severity: Minor
Found in app/helpers/host_helper/textual_summary.rb - About 2 hrs to fix

Class WorkflowRepositoryController has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

class WorkflowRepositoryController < ApplicationController
  before_action :check_prototype

  before_action :check_privileges
  before_action :get_session_data
Severity: Minor
Found in app/controllers/workflow_repository_controller.rb - About 2 hrs to fix

Class ContainerDashboardController has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

class ContainerDashboardController < ApplicationController
  extend ActiveSupport::Concern

  include Mixins::GenericSessionMixin
  include Mixins::BreadcrumbsMixin
Severity: Minor
Found in app/controllers/container_dashboard_controller.rb - About 2 hrs to fix

Function loadTable has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const loadTable = (values, tz, users) => {
  const filters = [];
  const {
    zone, timePeriod, taskStatus, taskState, user,
  } = values; // User selected values
Severity: Major
Found in app/javascript/components/settings-tasks-form/load-table-helper.js - About 2 hrs to fix

Method rbac_group_right_tree has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rbac_group_right_tree(selected_nodes)
    case @sb[:active_rbac_group_tab]
    when 'rbac_customer_tags'
      cats = Classification.categories.select do |c|
        c.show || !%w[folder_path_blue folder_path_yellow].include?(c.name) && !(c.read_only? || c.entries.empty?)
Severity: Major
Found in app/controllers/ops_controller/ops_rbac.rb - About 2 hrs to fix

File miq_ae_customization_controller.rb has 405 lines of code (exceeds 400 allowed). Consider refactoring.
Open

class MiqAeCustomizationController < ApplicationController
  require "English"
  include CustomButtons
  include OldDialogs
  include Dialogs
Severity: Minor
Found in app/controllers/miq_ae_customization_controller.rb - About 2 hrs to fix

Method fields_get_form_vars has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def fields_get_form_vars
    @ae_class = MiqAeClass.find_by(:id => @edit[:ae_class_id])
    @in_a_form = true
    @in_a_form_fields = true
    if params[:item].blank? && !%w[accept save].include?(params[:button]) && params["action"] != "field_delete"
Severity: Major
Found in app/controllers/miq_ae_class_controller.rb - About 2 hrs to fix

Method build_edit_screen has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def build_edit_screen
    build_tabs

    get_time_profiles # Get time profiles list (global and user specific)
    cb_entities_by_provider if Chargeback.db_is_chargeback?(@edit[:new][:model]) && [ChargebackContainerImage, ChargebackContainerProject, MeteringContainerImage, MeteringContainerProject].include?(@edit[:new][:model].safe_constantize)
Severity: Major
Found in app/controllers/report_controller/reports/editor.rb - About 2 hrs to fix

Method gfv_chargeback has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def gfv_chargeback
    # Chargeback options
    if params.key?(:cb_show_typ)
      @edit[:new][:cb_show_typ] = params[:cb_show_typ].presence
      @refresh_div = "filter_div"
Severity: Major
Found in app/controllers/report_controller/reports/editor.rb - About 2 hrs to fix

File schedules.rb has 405 lines of code (exceeds 400 allowed). Consider refactoring.
Open

module ReportController::Schedules
  extend ActiveSupport::Concern

  def show_schedule
    if @schedule.nil?
Severity: Minor
Found in app/controllers/report_controller/schedules.rb - About 2 hrs to fix

Function Datastore has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const Datastore = ({
  type, initialData, hasOptions, datastoreTypes,
}) => {
  const {
    miqHeaders, miqRows, hasCheckbox, nodeTree,
Severity: Minor
Found in app/javascript/components/data-tables/datastore/index.jsx - About 2 hrs to fix

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 OrcherstrationTemplateForm has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const OrcherstrationTemplateForm = ({ isStack, otId, copy }) => {
  const [initialValues, setinItialValues] = useState({});
  const [submitAction, setSubmitAction] = useState();
  const [isLoading, setLoading] = useState(true);

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 WorkflowRepositoryForm has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const WorkflowRepositoryForm = ({ repositoryId }) => {
  const [{
    initialValues, isLoading, provider,
  }, setState] = useState({
    isLoading: true,
Severity: Minor
Found in app/javascript/components/workflow-repository-form/index.jsx - About 2 hrs to fix

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 HostInitiatorForm has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const HostInitiatorForm = ({ redirect, storageManagerId }) => {
  const [state, setState] = useState({});
  const [storageId, setStorageId] = useState(undefined);
  const { isLoading, initialValues } = state;

Severity: Minor
Found in app/javascript/components/host-initiator-form/index.jsx - About 2 hrs to fix

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 report_information has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def report_information(sb_data, report)
    if sb_data[:miq_report_id] && report
      data = {:title => _('Basic Information'), :mode => 'miq_report_basic_information'}
      rows = []
      rows.push(row_data(_('ID'), report.id))
Severity: Minor
Found in app/helpers/report_helper/report_information_helper.rb - About 2 hrs to fix

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 AnsibleRepositoryForm has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const AnsibleRepositoryForm = ({ repositoryId }) => {
  const [{
    initialValues, isLoading, provider,
  }, setState] = useState({
    isLoading: true,
Severity: Minor
Found in app/javascript/components/ansible-repository-form/index.jsx - About 2 hrs to fix

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 EmbeddedTerraformRepositoryForm has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const EmbeddedTerraformRepositoryForm = ({ repositoryId }) => {
  const [{
    initialValues, isLoading, provider,
  }, setState] = useState({
    isLoading: true,

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 schema_data has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def schema_data(schema_data)
    schema_items = ["name", "description", "default_value", "collect", "message", "on_entry", "on_exit", "on_error", "max_retries", "max_time"]
    schema_data.each_with_index do |ae_field, index|
      cells = []
      icon = ae_field.substitute ? "pficon pficon-ok" : "pficon pficon-close"
Severity: Minor
Found in app/helpers/miq_ae_class_helper.rb - About 2 hrs to fix

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 group_information_summary has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def group_information_summary(group)
    rows = [
      row_data(_('ID'), group.id),
      row_data(_('Description'), group.description),
      row_data(_('Detailed Description'), group.detailed_description),
Severity: Minor
Found in app/helpers/ops_helper/group_rbac_details_helper.rb - About 2 hrs to fix

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

Severity
Category
Status
Source
Language