ikuseiGmbH/smart-village-app-cms

View on GitHub

Showing 98 of 1,254 total issues

Method edit has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def edit
    results = @smart_village.query <<~GRAPHQL
      query {
        newsItem(
          id: #{params[:id]}
Severity: Major
Found in app/controllers/news_items_controller.rb - About 3 hrs to fix

    Function getFormValues has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    formNode.prototype.getFormValues = function (updateArrayPath) {
      // The values object that will be returned
      var values = {};
    
      if (!this.el) {
    Severity: Major
    Found in lib/jsonform.js - About 2 hrs to fix

      Method edit has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def edit
          results = @smart_village.query <<~GRAPHQL
            query {
              genericItem(
                id: #{params[:id]}
      Severity: Major
      Found in app/controllers/jobs_controller.rb - About 2 hrs to fix

        Method convert_params_for_graphql has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def convert_params_for_graphql
              # Convert has_many categories
              if @event_params["categories"].present?
                categories = []
                @event_params["categories"].each do |_key, category|
        Severity: Major
        Found in app/controllers/events_controller.rb - About 2 hrs to fix

          Function onBeforeRender has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          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
          Severity: Major
          Found in lib/jsonform.js - About 2 hrs to fix

            Function getInitialValue has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var getInitialValue = function (formObject, key, arrayPath, tpldata, usePreviousValues) {
              var value = null;
            
              // Complete template data for template function
              tpldata = tpldata || {};
            Severity: Major
            Found in lib/jsonform.js - About 2 hrs to fix

              Function enhance has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              formNode.prototype.enhance = function () {
                var node = this;
                var handlers = null;
                var handler = null;
                var formData = _.clone(this.ownerTree.formDesc.tpldata) || {};
              Severity: Major
              Found in lib/jsonform.js - About 2 hrs to fix

                Function setDefaultValues has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var setDefaultValues = function (obj, schema, includeOptionalValues, skipFieldsWithoutDefaultValue) {
                    if (!obj || !schema) return obj;
                    if (!schema.properties) {
                      schema = { properties: schema };
                    }
                Severity: Major
                Found in lib/jsonform-defaults.js - About 2 hrs to fix

                  Function getArrayBoundaries has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  formNode.prototype.getArrayBoundaries = function () {
                    var boundaries = {
                      minItems: -1,
                      maxItems: -1
                    };
                  Severity: Major
                  Found in lib/jsonform.js - About 2 hrs to fix

                    Method edit has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def edit
                        results = @smart_village.query <<~GRAPHQL
                          query {
                            genericItem(
                              id: #{params[:id]}
                    Severity: Major
                    Found in app/controllers/offers_controller.rb - About 2 hrs to fix

                      Class WasteCalendarController has 22 methods (exceeds 20 allowed). Consider refactoring.
                      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]
                      Severity: Minor
                      Found in app/controllers/waste_calendar_controller.rb - About 2 hrs to fix

                        Method convert_params_for_graphql has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def convert_params_for_graphql
                              # Convert has_many categories
                              if @construction_params["categories"].present?
                                categories = []
                                @construction_params["categories"].each do |_key, category|
                        Severity: Major
                        Found in app/controllers/constructions_controller.rb - About 2 hrs to fix

                          Function setObjKey has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            var setObjKey = function (obj, key, value) {
                              var keyparts = key.split('.');
                          
                              // Recursive version of setObjKey
                              var recSetObjKey = function (obj, keyparts, value) {
                          Severity: Major
                          Found in lib/jsonform-defaults.js - About 2 hrs to fix

                            Method edit_survey_record has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def edit_survey_record
                                  results = @smart_village.query <<~GRAPHQL
                                    query {
                                      surveys(
                                        ids: [
                            Severity: Major
                            Found in app/controllers/surveys_controller.rb - About 2 hrs to fix

                              Method edit has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def edit
                                  results = @smart_village.query <<~GRAPHQL
                                    query {
                                      genericItem(
                                        id: #{params[:id]}
                              Severity: Major
                              Found in app/controllers/deadlines_controller.rb - About 2 hrs to fix

                                File waste_calendar_controller.rb has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                require "csv"
                                
                                class WasteCalendarController < ApplicationController
                                  before_action :verify_current_user
                                  before_action { verify_current_user_role("role_waste_calendar") }
                                Severity: Minor
                                Found in app/controllers/waste_calendar_controller.rb - About 2 hrs to fix

                                  Function setObjKey has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  jsonform.util.setObjKey = function(obj,key,value) {
                                    var innerobj = obj;
                                    var keyparts = key.split(".");
                                    var subkey = null;
                                    var arrayMatch = null;
                                  Severity: Major
                                  Found in lib/jsonform.js - About 2 hrs to fix

                                    Function getNodeBoundaries has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      var getNodeBoundaries = function (node, initialNode) {
                                        var schemaKey = null;
                                        var arrayKey = null;
                                        var boundaries = {
                                          minItems: -1,
                                    Severity: Major
                                    Found in lib/jsonform.js - About 2 hrs to fix

                                      Function initializeTabs has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      var initializeTabs = function (tabs) {
                                        var activate = function (element, container) {
                                          container
                                            .find('> .active')
                                            .removeClass('active');
                                      Severity: Major
                                      Found in lib/jsonform.js - About 2 hrs to fix

                                        Function generate has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        formNode.prototype.generate = function () {
                                          var data = {
                                            id: this.id,
                                            keydash: this.keydash,
                                            elt: this.formElement,
                                        Severity: Major
                                        Found in lib/jsonform.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language