ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Method drift_add_record_field has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def drift_add_record_field(view, section, record, field, ridx)
Severity: Minor
Found in app/controllers/application_controller/compare.rb - About 35 mins to fix

Method process_changed_expression has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def process_changed_expression(params, chosen_key, exp_key, exp_value, exp_valx)
Severity: Minor
Found in app/controllers/application_controller/filter/expression.rb - About 35 mins to fix

Method render_sync_page has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def render_sync_page(ems, selected_admin_role, selected_member_role, selected_password, selected_verify)
Severity: Minor
Found in app/controllers/ems_cloud_controller.rb - About 35 mins to fix

Method handle_selection_buttons_sync_async has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def handle_selection_buttons_sync_async(members, members_chosen, _choices, _choices_chosen, sync)
Severity: Minor
Found in app/controllers/mixins/policy_mixin.rb - About 35 mins to fix

Method handle_selection_buttons_up_down has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def handle_selection_buttons_up_down(members, members_chosen, _choices, _choices_chosen, up)
Severity: Minor
Found in app/controllers/mixins/policy_mixin.rb - About 35 mins to fix

Method format_server_utilization_data has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def format_server_utilization_data(total_servers, valid_servers, warning_servers, critical_servers, servers_with_host)
Severity: Minor
Found in app/services/ems_physical_infra_dashboard_service.rb - About 35 mins to fix

Method format_data has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def format_data(resource, attributes, attr_icon, attr_url, attr_hsh)
Severity: Minor
Found in app/services/dashboard_service.rb - About 35 mins to fix

Method count_only_or_objects_filtered has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def count_only_or_objects_filtered(count_only, objects, sort_by = nil, options = {}, &block)
Severity: Minor
Found in app/presenters/tree_builder.rb - About 35 mins to fix

Method format_data has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def format_data(resource, attributes, attr_icon, attr_url, attr_hsh)
Severity: Minor
Found in app/services/ems_dashboard_service.rb - About 35 mins to fix

Function getSubmitData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const getSubmitData = (values) => {
  let customIdentifier = '';
  let description = '';
  let parentResource = null;
  const childResources = [];
Severity: Minor
Found in app/javascript/components/vm-edit-form/helper.js - About 35 mins 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 miqQsEnterEscape has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

window.miqQsEnterEscape = function(e) {
  let keycode;

  if (window.event) {
    keycode = window.event.keyCode;
Severity: Minor
Found in app/javascript/oldjs/miq_application.js - About 35 mins 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 asyncValidator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const asyncValidator = (value, dashboardId, name) =>
  http.get(`/report/dashboard_get/${dashboardId}?name=${value}`)
    .then((json) => {
      if (value === name) {
        throw __('Use different name');

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

export default function textualSummaryGenericClick(item, event) {
  if (event) {
    event.preventDefault();
  }

Severity: Minor
Found in app/javascript/react/textual_summary_click.js - About 35 mins 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 EmbeddedTerraformCredentialsForm has a Cognitive Complexity of 7 (exceeds 5 allowed). 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');

Severity: Minor
Found in app/javascript/components/embedded-terraform-credentials-form/index.jsx - About 35 mins 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 HostAggregateForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const HostAggregateForm = ({ recordId }) => {
  const [{ initialValues, isLoading, emsId }, setState] = useState({ isLoading: !!recordId });

  useEffect(() => {
    if (recordId) {
Severity: Minor
Found in app/javascript/components/host-aggregate-form/index.jsx - About 35 mins 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 asyncValidator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const asyncValidator = (value, catalogId) =>
  API.get(`/api/service_catalogs?expand=resources&filter[]=name='${value ? value.replace('%', '%25') : ''}'`)
    .then((json) => {
      if (json.resources.find(({ id, name }) => name === value && id !== catalogId)) {
        throw __('Name has already been taken');
Severity: Minor
Found in app/javascript/components/catalog-form/catalog-form.schema.js - About 35 mins 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 asyncValidator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const asyncValidator = (value, serverId) =>
  API.get(`/api/pxe_servers?expand=resources&filter[]=name='${value ? value.replace('%', '%25') : ''}'`)
    .then((json) => {
      if (json.resources.find(({ id, name }) => name === value && id !== serverId)) {
        throw __('Name has already been taken');
Severity: Minor
Found in app/javascript/components/pxe-servers-form/pxe-server-form.schema.js - About 35 mins 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 CloudObjectStoreContainerForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const CloudObjectStoreContainerForm = () => {
  const [{
    initialValues, fields, isLoading,
  }, setState] = useState({});

Severity: Minor
Found in app/javascript/components/cloud-object-store-container-form/index.jsx - About 35 mins 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 ZoneForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const ZoneForm = ({ recordId }) => {
  const [{ initialValues, isLoading }, setState] = useState({
    isLoading: !!recordId,
  });

Severity: Minor
Found in app/javascript/components/zone-form/index.jsx - About 35 mins 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 AnsibleCredentialsForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const AnsibleCredentialsForm = ({ recordId }) => {
  const [{ fields, initialValues, isLoading }, setState] = useState({ fields: [], isLoading: !!recordId });
  const promise = useMemo(() => API.options('/api/authentications'), []);
  const submitLabel = !!recordId ? __('Save') : __('Add');

Severity: Minor
Found in app/javascript/components/ansible-credentials-form/index.jsx - About 35 mins 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