ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

Function miqJqueryRequest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

window.miqJqueryRequest = function(url, options) {
  if ((ManageIQ.observe.processing || ManageIQ.observe.queue.length) && (!options || !options.observe)) {
    console.debug('Postponing miqJqueryRequest - waiting for the observe queue to empty first');

    return new Promise((resolve, reject) => {
Severity: Minor
Found in app/javascript/oldjs/miq_application.js - About 1 hr 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 selectListElement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

var selectListElement = function(scope, timeout, ctrl, refresh) {
  timeout(function() {
    if (refresh) {
      if (scope[scope['form_' + ctrl.$name + '_ngHide']] === true) {
        angular.element(scope['form_' + ctrl.$name]).selectpicker('hide');

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

  controller: function() {
    this.buttonClicked = function(event) {
      if (this.enabled) {
        this.onClick();
      }
Severity: Minor
Found in app/javascript/oldjs/components/miq-button.js - About 1 hr 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 miqValidateButtons has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

window.miqValidateButtons = function(h_or_s, prefix) {
  const buttonPrefix = prefix || '';
  const buttonsOnId = `${buttonPrefix}validate_buttons_on`;
  const buttonsOffId = `${buttonPrefix}validate_buttons_off`;

Severity: Minor
Found in app/javascript/oldjs/miq_application.js - About 1 hr 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 load_c3_charts has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

window.load_c3_charts = function() {
  for (var set in ManageIQ.charts.chartData) {
    for (var i = 0; i < ManageIQ.charts.chartData[set].length; i++) {
      var chart_id = 'miq_chart_' + set + '_' + i.toString();
      var data = ManageIQ.charts.chartData[set][i];
Severity: Minor
Found in app/javascript/oldjs/miq_c3.js - About 1 hr 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 miqOnLoad has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

window.miqOnLoad = function() {
  // controller to be used in url in miqDropComplete method
  ManageIQ.widget.dashboardUrl = 'dashboard/widget_dd_done';

  // Initialize the dashboard column sortables
Severity: Minor
Found in app/javascript/oldjs/miq_application.js - About 1 hr 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 UtilizationChartGraph has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const UtilizationChartGraph = ({
  providerId, title, cpuConfig, memoryConfig, dashboard,
}) => {
  const [data, setCardData] = useState({ loading: 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 getItemIcon has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const getItemIcon = (item) => {
  if (item.FinishedTime) {
    if (item.Output && item.Output.Error) {
      if (item.RetryCount) {
        return { icon: 'carbon--RetryFailed' }
Severity: Minor
Found in app/javascript/components/request-workflow-status/data.js - About 1 hr 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 toBytes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const toBytes = (value) => {
  if (!value) return undefined;

  if (typeof value !== 'number') {
    const sizeValue = value.match(/^\d+(\.\d+)*/)[0];
Severity: Minor
Found in app/javascript/components/workers-form/helpers.jsx - About 1 hr 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 DataTable has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const DataTable = ({
  rows,
  columns,
  inEditMode,
  noCheckboxes,
Severity: Minor
Found in app/javascript/components/data-tables/gtl/DataTable.jsx - About 1 hr 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 deleteNetwork has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const deleteNetwork = (row, data, setData, roles) => {
  let dataTableData = data.dataTable.networkAdapters || [];
  let submitNetworks = data.submitParams.networks.add || [];
  let addNetworkIds = data.submitParams.networkIds.add || [];
  const deleteNetworksData = data.submitParams.networks.delete || [];
Severity: Minor
Found in app/javascript/components/reconfigure-vm-form/helpers/network.js - About 1 hr 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 CustomButtonForm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const CustomButtonForm = ({
  recId, url, appliesToClass, appliesToId, customButtonGroupId, distinctInstances, ansiblePlaybooks,
}) => {
  const [{
    isLoading, initialValues, buttonIcon, roles, serviceDialogs,

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

export const setNetworkFormSubmit = (data, setData, formData, roles, renderData) => {
  if (data.form.action === 'add') {
    // code for add function
    const id = `network${data.dataTable.networkAdapters.length}`;
    const networkData = {
Severity: Minor
Found in app/javascript/components/reconfigure-vm-form/helpers/network.js - About 1 hr 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 ToolbarList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const ToolbarList = (props) => {
  const count = useContext(CountContext);
  const { items, title, id } = props;
  // Set this true for overflowmenu keydown event
  const [overflowTab, setOverflowTab] = useState(false);
Severity: Minor
Found in app/javascript/components/toolbar/ToolbarList.jsx - About 1 hr 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 MiqAeCustomization has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const MiqAeCustomization = ({ dialogRecord, dialogTypes }) => {
  const [data, setData] = useState({
    isLoading: true,
    initialValues: undefined,
  });
Severity: Minor
Found in app/javascript/components/miq-ae-customization/index.jsx - About 1 hr 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 PxeServersForm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const PxeServersForm = ({ id }) => {
  const [initialValues, setInitialValues] = useState({});
  const [isLoading, setIsLoading] = useState(!!id);

  useEffect(() => {
Severity: Minor
Found in app/javascript/components/pxe-servers-form/pxe-server-form.jsx - About 1 hr 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 update_from_hash has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def update_from_hash(params)
      %w[typ moths weeks days hours].each do |i|
        self[i] = params[:"timer_#{i}"] if params[:"timer_#{i}"]
      end
      %w[start_hour start_min].each do |i|
Severity: Minor
Found in app/helpers/report_helper/timer.rb - About 1 hr 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 textual_compliance_status has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def textual_compliance_status
    h = {:label => _("Status")}
    if @record.number_of(:compliances).zero?
      h[:value] = _("Never Verified")
    else
Severity: Minor
Found in app/helpers/compliance_summary_helper.rb - About 1 hr 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 multiple_relationship_link has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def multiple_relationship_link(record, table_name)
      return unless role_allows?(:feature => "#{table_name}_show_list")
      return if table_name == 'container_route' && !record.respond_to?(:container_routes)

      plural = ui_lookup(:tables => table_name.to_s)
Severity: Minor
Found in app/helpers/application_helper/listnav.rb - About 1 hr 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 ns_list_data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def ns_list_data(grid_data)
    has_options = User.current_user.super_admin_user?
    datastore_options(has_options)
    grid_data.each do |record|
      next if record.name == '$'
Severity: Minor
Found in app/helpers/miq_ae_class_helper.rb - About 1 hr 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