Showing 98 of 1,254 total issues
Method edit
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def edit
results = @smart_village.query <<~GRAPHQL
query {
newsItem(
id: #{params[:id]}
Function getFormValues
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formNode.prototype.getFormValues = function (updateArrayPath) {
// The values object that will be returned
var values = {};
if (!this.el) {
Method edit
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def edit
results = @smart_village.query <<~GRAPHQL
query {
genericItem(
id: #{params[:id]}
Method convert_params_for_graphql
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def convert_params_for_graphql
# Convert has_many categories
if @event_params["categories"].present?
categories = []
@event_params["categories"].each do |_key, category|
Function onBeforeRender
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
'onBeforeRender': function (data, node) {
// Before rendering, this function ensures that:
// 1. direct children have IDs (used to show/hide the tabs contents)
// 2. the tab to active is flagged accordingly. The active tab is
// the first one, except if form values are available, in which case
Function getInitialValue
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getInitialValue = function (formObject, key, arrayPath, tpldata, usePreviousValues) {
var value = null;
// Complete template data for template function
tpldata = tpldata || {};
Function enhance
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formNode.prototype.enhance = function () {
var node = this;
var handlers = null;
var handler = null;
var formData = _.clone(this.ownerTree.formDesc.tpldata) || {};
Function setDefaultValues
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setDefaultValues = function (obj, schema, includeOptionalValues, skipFieldsWithoutDefaultValue) {
if (!obj || !schema) return obj;
if (!schema.properties) {
schema = { properties: schema };
}
Function getArrayBoundaries
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formNode.prototype.getArrayBoundaries = function () {
var boundaries = {
minItems: -1,
maxItems: -1
};
Method edit
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def edit
results = @smart_village.query <<~GRAPHQL
query {
genericItem(
id: #{params[:id]}
Class WasteCalendarController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class WasteCalendarController < ApplicationController
before_action :verify_current_user
before_action { verify_current_user_role("role_waste_calendar") }
before_action :init_graphql_client
before_action :determine_waste_types, only: %i[index new edit_tour edit_location tour_dates]
Method convert_params_for_graphql
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def convert_params_for_graphql
# Convert has_many categories
if @construction_params["categories"].present?
categories = []
@construction_params["categories"].each do |_key, category|
Function setObjKey
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setObjKey = function (obj, key, value) {
var keyparts = key.split('.');
// Recursive version of setObjKey
var recSetObjKey = function (obj, keyparts, value) {
Method edit_survey_record
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def edit_survey_record
results = @smart_village.query <<~GRAPHQL
query {
surveys(
ids: [
Method edit
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def edit
results = @smart_village.query <<~GRAPHQL
query {
genericItem(
id: #{params[:id]}
File waste_calendar_controller.rb
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "csv"
class WasteCalendarController < ApplicationController
before_action :verify_current_user
before_action { verify_current_user_role("role_waste_calendar") }
Function setObjKey
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jsonform.util.setObjKey = function(obj,key,value) {
var innerobj = obj;
var keyparts = key.split(".");
var subkey = null;
var arrayMatch = null;
Function getNodeBoundaries
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getNodeBoundaries = function (node, initialNode) {
var schemaKey = null;
var arrayKey = null;
var boundaries = {
minItems: -1,
Function initializeTabs
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var initializeTabs = function (tabs) {
var activate = function (element, container) {
container
.find('> .active')
.removeClass('active');
Function generate
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formNode.prototype.generate = function () {
var data = {
id: this.id,
keydash: this.keydash,
elt: this.formElement,