Showing 22 of 30 total issues
Class Entity
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Entity
# rubocop:disable Metrics/ModuleLength, Naming/MethodName
module Attributes
# Schema: person
def cn
Class StudentCourseEnrollmentService
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class StudentCourseEnrollmentService # rubocop:disable Metrics/ClassLength
ECTS = 30
CompulsoryCourseGroup = OpenStruct.new(name: 'compulsories', completed: false)
EnrollableError = Class.new(StandardError)
Function exports
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
Function DynamicSelect
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
var DynamicSelect = function (parameters) { // eslint-disable-line no-unused-vars
var Store = {}
function init () {
$.each(parameters, function (k, parameter) {
Method prospective_student_params
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def prospective_student_params
params.require(:prospective_student).permit(
:academic_term_id,
:additional_score,
:address,
Function OptionsBuilder
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var OptionsBuilder = function (datas, config = {}) {
var options = []
function build () {
if (options.length > 0) return options
- 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 merge_keep!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def merge_keep!(other)
merge!(other)
self.class.members.each do |member|
next if (value = __send__(member)).nil?
next unless (member_string = member.to_s).end_with? SUFFIX_INDICATING_KEEP
- 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_operations_for_update
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def build_operations_for_update(entity)
current_values = find_values_via_ldap(entity).with_indifferent_access
values = entity.values.with_indifferent_access
operations = []
- 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
Function TelInputValidation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var TelInputValidation = function (inputId, errorMsgId, errorMessages) { // eslint-disable-line no-unused-vars
var input = document.querySelector(inputId)
var errorMsg = document.querySelector(errorMsgId)
var reset = function () {
Method load
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load(fallback: DEFAULT_TENANT)
tenant = self.name = (ENV['NOKUL_TENANT'] || fallback)&.downcase
raise Error::LoadError, 'No tenant defined through NOKUL_TENANT environment' if tenant.blank?
raise Error::LoadError, 'Tenant "common" is not a concrete tenant' if tenant == 'common'
- 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 find_values_via_ldap
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def find_values_via_ldap(entity)
current_values = find_by(entity.dn, uid: entity.uid)
Entity::ATTRIBUTES.each_with_object({}) do |(attribute, type), hash|
value = current_values.public_send(attribute.downcase)
hash[attribute] = (type == :single ? value.first : value)
- 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 update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update
if user_params[:password].blank? || user_params[:password_confirmation].blank?
@user.update_without_password(user_params) ? redirect_with('.success') : render(:edit)
else
@user.update(user_params) ? redirect_with('.success') : render(:edit)
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
@prospective_employee = ProspectiveEmployee.new(prospective_employee_params)
prospective = FirstRegistration::ProspectiveService.new(@prospective_employee)
if prospective.register
- 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 included
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def included(base)
super
# Support mixins as in the following use cases
- 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 dynamic_search
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dynamic_search(params = {})
raise ArgumentError, 'parameter must be Hash' unless [ActionController::Parameters, Hash].include?(params.class)
results = dynamic_where(params)
- 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 process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process(page: 0)
response = Xokul::Yoksis::Prospectives.all(@type, @year, page: page) || {}
response.fetch(:data, []).each do |params|
Actions::ProspectiveStudent::Upsert.call(params.merge(year: @year), academic_term: @academic_term)
- 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 with_backup_and_notification
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def with_backup_and_notification(new_file, **options, &block)
new_file_exist_before = File.exist? new_file
return if !with_backup(new_file, &block) || options[:quiet]
old_file_exist = File.exist? old_file = "#{new_file}.old"
- 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 save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save
return redirect_with('not_draft_error') unless @assessment.draft?
return redirect_with('not_fully_graded_error') unless @assessment.fully_graded?
@assessment.update(status: :saved) ? redirect_with('success') : redirect_with('error')
- 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 with_status_and_notification
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def with_status_and_notification(new_file, **options, &block)
new_file_exist_before = File.exist? new_file
status = with_status(new_file, &block)
- 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 scope
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def scope(bypass: nil)
return model.all if bypass.nil? ? bypass? : bypass
query = Query::Builder.call(self)
- 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"