Katello/katello

View on GitHub

Showing 2,737 of 2,737 total issues

Method initialize has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def initialize(attributes = {})
    if (!attributes.is_a?(Hash))
      fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeOstreeDistribution` initialize method"
    end

Severity: Minor
Found in lib/monkeys/remove_hidden_distribution.rb - About 1 hr to fix

    Method initialize has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def initialize(attributes = {})
        if (!attributes.is_a?(Hash))
          fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::AnsibleAnsibleDistribution` initialize method"
        end
    
    
    Severity: Minor
    Found in lib/monkeys/remove_hidden_distribution.rb - About 1 hr to fix

      Method initialize has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def initialize(attributes = {})
          if (!attributes.is_a?(Hash))
            fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebAptDistribution` initialize method"
          end
      
      
      Severity: Minor
      Found in lib/monkeys/remove_hidden_distribution.rb - About 1 hr to fix

        Method initialize has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def initialize(attributes = {})
            if (!attributes.is_a?(Hash))
              fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmRpmDistribution` initialize method"
            end
        
        
        Severity: Minor
        Found in lib/monkeys/remove_hidden_distribution.rb - About 1 hr to fix

          Method initialize has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def initialize(attributes = {})
              if (!attributes.is_a?(Hash))
                fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFileDistribution` initialize method"
              end
          
          
          Severity: Minor
          Found in lib/monkeys/remove_hidden_distribution.rb - About 1 hr to fix

            Function SelectAllCheckbox has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            const SelectAllCheckbox = ({
              selectNone,
              selectPage,
              selectedCount,
              pageRowCount,
            Severity: Minor
            Found in webpack/components/SelectAllCheckbox/index.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 ChangeHostCVModal has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            const ChangeHostCVModal = ({
              isOpen,
              closeModal,
              hostEnvId,
              orgId,

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

            export const setContentOverrides = ({
              hostId,
              search,
              enabled,
              limit_to_env: limitToEnv,

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

            KT.object.label = (function(){
                var initial_name_value,
                    retrieve_label = true,
            
                    initialize = function(){
            Severity: Minor
            Found in app/assets/javascripts/katello/common/katello_object.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 LastSync has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            const LastSync = ({
              lastSyncWords, lastSync, emptyMessage, startedAt,
            }) => {
              if (lastSync && lastSyncWords) {
                let Icon;
            Severity: Minor
            Found in webpack/scenes/ContentViews/Details/Repositories/LastSync.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 ActivationKeysSearch has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            const ActivationKeysSearch = () => {
              const ACTIVATION_KEYS = 'ACTIVATION_KEYS';
              const KT_AK_LABEL = 'kt_activation_keys';
              const [selectedEnvId, setSelectedEnvId] = useState(getSelectedEnvId());
              const [selectedContentViewId, setSelectedContentViewId] = useState(getSelectedContentViewId());
            Severity: Minor
            Found in webpack/components/ActivationKeysSearch/index.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 ContentViewTable has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            const ContentViewTable = () => {
              const response = useSelector(selectContentViews);
              const status = useSelector(selectContentViewStatus);
              const error = useSelector(selectContentViewError);
              const [searchQuery, updateSearchQuery] = useState('');
            Severity: Minor
            Found in webpack/scenes/ContentViews/Table/ContentViewsTable.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 withOrganization has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function withOrganization(WrappedComponent) {
              class CheckOrg extends Component {
                constructor(props) {
                  super(props);
                  this.state = { orgId: null };
            Severity: Minor
            Found in webpack/components/WithOrganization/withOrganization.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 render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              render() {
                const currentOrg = orgId();
                const {
                  deleteModalOpened, openDeleteModal, closeDeleteModal,
                  deleteButtonDisabled, disableDeleteButton, enableDeleteButton,
            Severity: Minor
            Found in webpack/scenes/Subscriptions/SubscriptionsPage.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

            Method message has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def message
                  # Retrieve a text message that may be rendered for a task's status.  This is used in various places,
                  # such as System Event history.
                  details = TaskStatus::TYPES[self.task_type]
                  return _("Non-system event") if details.nil?
            Severity: Minor
            Found in app/models/katello/task_status.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 update_attributes_with_logics! has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def update_attributes_with_logics!(params)
                  transaction do
                    fail _("No recurring logic tied to the sync plan.") if self.foreman_tasks_recurring_logic.nil?
                    params["cron_expression"] = '' if (params.key?("interval") && !params["interval"].eql?(CUSTOM_CRON) && self.interval.eql?(CUSTOM_CRON))
                    self.update!(params.except(:enabled))
            Severity: Minor
            Found in app/models/katello/sync_plan.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 content_options has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def content_options(host, selected_id, object_type, options = {})
                  include_blank = options.fetch(:include_blank, nil)
                  include_blank = '<option></option>' if include_blank == true #check for true specifically
                  orgs = relevant_organizations(host)
                  all_options = []
            Severity: Minor
            Found in app/helpers/katello/hosts_and_hostgroups_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 update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def update
                  async = ::Foreman::Cast.to_bool(params.fetch(:async, true))
                  update_params = environment_params
                  fail HttpErrors::BadRequest, _("Can't update the '%s' environment") % "Library" if @environment.library? && update_params.empty?
                  update_params[:name] = params[:environment][:new_name] if params[:environment][:new_name]
            Severity: Minor
            Found in app/controllers/katello/api/v2/environments_controller.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 update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def update
                  update_params = rule_params
                  update_params[:name] = update_params[:name].first if update_params[:name]
            
                  if @rule.filter.content_type == ContentViewPackageFilter::CONTENT_TYPE

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

                def current_organization_object
                  if !session[:current_organization_id]
                    @current_org = Organization.current
                    return @current_org
                  else
            Severity: Minor
            Found in app/controllers/katello/application_controller.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