theforeman/foreman

View on GitHub

Showing 722 of 1,271 total issues

Function onSubmit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onSubmit = () => {
    if (isNew || param.associated_type !== HOST_PARAM) {
      dispatch(
        APIActions.post({
          url: `/api/hosts/${hostId}/parameters/`,

    Function update_capabilities has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function update_capabilities(capabilities) {
      capabilities = capabilities.split(' ');
      $('#image_provisioning').empty();
      $('#image_selection').appendTo($('#image_provisioning'));
      update_provisioning_image();
    Severity: Minor
    Found in app/assets/javascripts/host_edit.js - About 1 hr to fix

      Function ModelsPage has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const ModelsPage = () => {
        const columns = {
          name: {
            title: __('Name'),
            wrapper: ({ can_edit: canEdit, id, name }) =>

        Function instanceTypeSelected has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function instanceTypeSelected(item) {
          const instanceType = $(item).val();
        
          if (!item.disabled) {
            const url = $(item).attr('data-url');
        Severity: Minor
        Found in webpack/assets/javascripts/compute_resource/ovirt.js - About 1 hr to fix

          Function methodSignature has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const methodSignature = (method, isSnippet) => {
            if (isEmpty(method.params)) return method.name;
          
            let currParam = 1;
            const params = method.params.map(p => {

            Function removeWidget has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function removeWidget(item) {
              const widget = $(item).parents('li.gs-w');
              const gridster = $('.gridster>ul')
                .gridster()
                .data('gridster');
            Severity: Minor
            Found in webpack/assets/javascripts/dashboard/index.js - About 1 hr to fix

              Method select_f has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def select_f(f, attr, array, id, method, select_options = {}, html_options = {})
                  array = array.to_a.dup
                  disable_button = select_options.delete(:disable_button)
                  include_blank = select_options.delete(:include_blank)
                  disable_button_enabled = select_options.delete(:disable_button_enabled)
              Severity: Minor
              Found in app/helpers/form_helper.rb - About 1 hr to fix

                Method template_input_f has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def template_input_f(f, options = {})
                    input_value = f.object
                    input = input_value.template_input
                
                    options.reverse_merge!(label: input.name, id: input.name, label_help: input.description.presence, required: input.required)
                Severity: Minor
                Found in app/helpers/templates_helper.rb - About 1 hr to fix

                  Method auth_smart_proxy has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def auth_smart_proxy(proxies = SmartProxy.unscoped.all)
                      request_hosts = nil
                      if request.ssl?
                        # If we have the client certficate in the request environment we can extract the dn and sans from there
                        # if not we use the dn in the request environment
                  Severity: Minor
                  Found in app/controllers/concerns/foreman/controller/smart_proxy_auth.rb - About 1 hr to fix

                    Method os_release has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def os_release
                        case os_name
                        when /(windows)/i
                          facts[:kernelrelease]
                        when /AIX/i
                    Severity: Minor
                    Found in app/services/puppet_fact_parser.rb - About 1 hr to fix

                      Function handleSubmit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const handleSubmit = (values, actions) => {
                          let submitValues = { setting: values };
                      
                          if (setting && setting.settingsType === 'array') {
                            const splitValue =

                        Function fill_in_matchers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function fill_in_matchers() {
                          $('.matchers').each(function() {
                            var matcher = $(this);
                            var match = matcher.find('.match').val();
                            var matcher_key = matcher.find('.matcher_key');
                        Severity: Minor
                        Found in app/assets/javascripts/lookup_keys.js - About 1 hr to fix

                          Function ImpersonateIcon has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const ImpersonateIcon = props => {
                            const [showModal, setShowModal] = useState(false);
                          
                            const toggleModal = () => setShowModal(!showModal);
                          
                          

                            Method index has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def index
                                respond_to do |format|
                                  format.json do
                                    reports = resource_base_search_and_page(:host)
                                    render json: {
                            Severity: Minor
                            Found in app/controllers/config_reports_controller.rb - About 1 hr to fix

                              Method build has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    def build
                                      if Foreman::Cast.to_bool(params[:rebuild_configuration])
                                        rebuild_config
                                      else
                                        reboot = Foreman::Cast.to_bool(params[:reboot])
                              Severity: Minor
                              Found in app/controllers/api/v2/hosts_bulk_actions_controller.rb - About 1 hr to fix

                                Method register_rails has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def register_rails
                                      if enabled?
                                        ActiveSupport::Notifications.subscribe(/process_action.action_controller/) do |*args|
                                          event = ActiveSupport::Notifications::Event.new(*args)
                                          controller = event.payload[:controller].underscore
                                Severity: Minor
                                Found in lib/foreman/telemetry.rb - About 1 hr to fix

                                  Function allocationSwitcher has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function allocationSwitcher(element, action) {
                                    const previous = $(element)
                                      .parent()
                                      .find('.active');
                                  
                                  
                                  Severity: Minor
                                  Found in webpack/assets/javascripts/compute_resource/libvirt.js - About 1 hr to fix

                                    Method set_interfaces has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def set_interfaces(parser)
                                          # if host has no information in primary interface we try to match it and update it
                                          # instead of creating new interface, suggested primary interface mac and identifier
                                          # is saved to primary interface so we match it in updating code below
                                          if !managed? && primary_interface.mac.blank? && primary_interface.identifier.blank?
                                    Severity: Minor
                                    Found in app/models/host/base.rb - About 1 hr to fix

                                      Method multiple_selects has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        def multiple_selects(f, attr, associations, selected_ids, options = {}, html_options = {})
                                          options[:size] = "col-md-10"
                                          case attr
                                            when :organizations
                                              klass = Organization
                                      Severity: Minor
                                      Found in app/helpers/form_helper.rb - About 1 hr to fix

                                        Method initiate_connection! has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def initiate_connection!
                                            Timeout.timeout(Setting[:ssh_timeout].to_i) do
                                              Timeout.timeout(8) do
                                                ssh.run('pwd')
                                              end
                                        Severity: Minor
                                        Found in app/services/foreman/provision/ssh.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language