Showing 110 of 110 total issues
File children_form_section_setup.rb
has 683 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module RapidFTR
module ChildrenFormSectionSetup
def self.build_form_sections
form_sections = []
form_sections << build_basic_identity_section
Method reset_definitions
has 207 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.reset_definitions
form = Form.find_by_name(Child::FORM_NAME)
outcome_of_follow_up_visit_fields = [
Field.new('name' => 'was_child_seen',
'type' => 'select_box',
Method build_family_details_section
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.build_family_details_section
family_details_fields = [
Field.new('name' => 'fathers_name',
'type' => 'text_field',
'display_name_all' => "Father's Name",
Function advancedSearch
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.advancedSearch = function (options) {
var element = $(this);
var self = this;
var menu = element.find(".criteria_menu");
Class FormSection
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class FormSection < CouchRest::Model::Base
include RapidFTR::Model
include PropertiesLocalization
use_database :form_section
localize_properties [:name, :help_text, :description]
Function init
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ManagePhotos.init = function() {
_.templateSettings = {
interpolate : /\{\{(.+?)\}\}/g
};
File enquiries_form_section_setup.rb
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module RapidFTR
module EnquiriesFormSectionSetup
def self.build_form_sections
form_sections = []
form_sections << build_details_of_adult_seeking_child_section
Method build_basic_identity_section
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.build_basic_identity_section
basic_identity_fields = [
Field.new('name' => 'name',
'type' => 'text_field',
'highlight_information' => HighlightInformation.new('highlighted' => true, 'order' => 1),
Function init
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ManageUsers.init = function () {
window.User = Backbone.Model.extend ({
changeDisabledStatus: function(disabledStatus) {
var userAttributes = {"user[disabled]": disabledStatus, "authenticity_token": this.token()};
$.ajax({
Class Replication
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Replication < CouchRest::Model::Base
MODELS_TO_SYNC = [Role, Child, User, MobileDbKey, Device, Form, FormSection]
STABLE_WAIT_TIME = 2.minutes
include RapidFTR::Model
Class Enquiry
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Enquiry < BaseModel
use_database :enquiry
require 'uuidtools'
include Searchable
Class Child
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Child < BaseModel
use_database :child
require 'uuidtools'
include Extensions::CustomValidator::CustomFieldsValidator
Method build_interview_details_section
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.build_interview_details_section
interview_details_fields = [
Field.new('name' => 'disclosure_public_name',
'type' => 'select_box',
'display_name_all' => 'Does Child/Caregiver agree to share name on posters/radio/Internet?',
Method build_child_wishes_section
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.build_child_wishes_section
child_wishes_fields = [
Field.new('name' => 'wishes_name_1',
'type' => 'text_field',
'display_name_all' => 'Person child wishes to locate - Preferred',
Method build_details_of_adult_seeking_child_section
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.build_details_of_adult_seeking_child_section
details_of_adult_seeking_child_fields = [
Field.new('name' => 'enq_first_name',
'type' => 'text_field',
'highlight_information' => HighlightInformation.new('highlighted' => true, 'order' => 1),
Method formatted_hash
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
def formatted_hash
properties_hash = {}
properties.map(&:name).each do |property|
locale = property[-2..-1]
property_name = property[0..property.length - 4]
- Read upRead up
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 build_details_of_child_sought_fields_section
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.build_details_of_child_sought_fields_section
details_of_child_sought_fields = [
Field.new('name' => '2_first_name',
'type' => 'text_field',
'display_name_all' => 'First Name',
Method build_protection_concerns_section
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.build_protection_concerns_section
protection_concerns_fields = [
Field.new('name' => 'concerns_chh',
'type' => 'select_box',
'display_name_all' => 'Child Headed Household',
Class User
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class User < CouchRest::Model::Base
use_database :user
include RapidFTR::Model
include RapidFTR::CouchRestRailsBackward
Class Field
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Field
include CouchRest::Model::CastedModel
include RapidFTR::Model
include PropertiesLocalization