Showing 722 of 1,271 total issues
Function onSubmit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
function update_capabilities(capabilities) {
capabilities = capabilities.split(' ');
$('#image_provisioning').empty();
$('#image_selection').appendTo($('#image_provisioning'));
update_provisioning_image();
Function ModelsPage
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
export function instanceTypeSelected(item) {
const instanceType = $(item).val();
if (!item.disabled) {
const url = $(item).attr('data-url');
Function methodSignature
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
export function removeWidget(item) {
const widget = $(item).parents('li.gs-w');
const gridster = $('.gridster>ul')
.gridster()
.data('gridster');
Method select_f
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Method template_input_f
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Method auth_smart_proxy
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method os_release
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def os_release
case os_name
when /(windows)/i
facts[:kernelrelease]
when /AIX/i
Function handleSubmit
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
function fill_in_matchers() {
$('.matchers').each(function() {
var matcher = $(this);
var match = matcher.find('.match').val();
var matcher_key = matcher.find('.matcher_key');
Function ImpersonateIcon
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
def index
respond_to do |format|
format.json do
reports = resource_base_search_and_page(:host)
render json: {
Method build
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def build
if Foreman::Cast.to_bool(params[:rebuild_configuration])
rebuild_config
else
reboot = Foreman::Cast.to_bool(params[:reboot])
Method register_rails
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function allocationSwitcher
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function allocationSwitcher(element, action) {
const previous = $(element)
.parent()
.find('.active');
Method set_interfaces
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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?
Method multiple_selects
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def multiple_selects(f, attr, associations, selected_ids, options = {}, html_options = {})
options[:size] = "col-md-10"
case attr
when :organizations
klass = Organization
Method initiate_connection!
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initiate_connection!
Timeout.timeout(Setting[:ssh_timeout].to_i) do
Timeout.timeout(8) do
ssh.run('pwd')
end