Showing 483 of 922 total issues
Method merge!
has a Cognitive Complexity of 270 (exceeds 5 allowed). Consider refactoring. Open
def merge!
logger.tagged("Merge ##{merge.id}") do
referential.switch do
Chouette::ChecksumUpdater.new(referential).update
end
- 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
File netex_generic.rb
has 1692 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Export::NetexGeneric < Export::Base
include LocalExportSupport
option :profile, enumerize: %w[none french european idfm/iboo idfm/icar idfm/full], default: :none
option :duration
File gtfs.rb
has 1375 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Import::Gtfs < Import::Base
include LocalImportSupport
after_commit :update_main_resource_status, on: [:create, :update]
File gtfs.rb
has 1351 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Export::Gtfs < Export::Base
include LocalExportSupport
option :period, default_value: 'all_periods', enumerize: %w[all_periods only_next_days static_day_period]
option :duration
File netex_generic.rb
has 1101 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Import
class NetexGeneric < Import::Base
include LocalImportSupport
include Imports::WithoutReferentialSupport
actions
has 94 functions (exceeds 20 allowed). Consider refactoring. Open
const actions = {
enterEditMode: () => ({
type: "ENTER_EDIT_MODE"
}),
exitEditMode: () => ({
Class Referential
has 92 methods (exceeds 20 allowed). Consider refactoring. Open
class Referential < ApplicationModel
prepend ReferentialSaveWithLock
include DataFormatEnumerations
include ObjectidFormatterSupport
Method merge!
has 310 lines of code (exceeds 25 allowed). Consider refactoring. Open
def merge!
logger.tagged("Merge ##{merge.id}") do
referential.switch do
Chouette::ChecksumUpdater.new(referential).update
end
File base.rb
has 664 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Search
class Base
extend ActiveModel::Naming
extend Enumerize
File referential.rb
has 647 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ReferentialSaveWithLock
def save(options = {})
super(options)
rescue ActiveRecord::StatementInvalid => e
Chouette::Safe.capture "Referential #{name} with slug #{slug} save failed", e
Class StopArea
has 76 methods (exceeds 20 allowed). Consider refactoring. Open
class StopArea < Chouette::ActiveRecord
include StopAreaReferentialSupport
has_metadata
include ProjectionFields
Function modal
has 279 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function modal(state = {}, action) {
switch (action.type) {
case 'OPEN_CONFIRM_MODAL':
$('#ConfirmModal').modal('show')
return _.assign({}, state, {
File index.js
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { batchActions } from '../batch'
const actions = {
enterEditMode: () => ({
type: "ENTER_EDIT_MODE"
Method tr
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
def tr item, columns, selectable, links, overhead, model_name, action
klass = "#{model_name} #{model_name}-#{item.id}"
content_tag :tr, class: klass do
bcont = []
if selectable
- 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
File time_table.rb
has 578 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Chouette
class TimeTable < Referential::Model
include ApplicationDaysSupport
include ObjectidSupport
include TimetableSupport
Method attribute
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
def attribute(attribute_name, options = {})
resource = options[:object] || object
if options.key?(:value)
raw_value = options[: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
Class TimeTable
has 63 methods (exceeds 20 allowed). Consider refactoring. Open
class TimeTable < Referential::Model
include ApplicationDaysSupport
include ObjectidSupport
include TimetableSupport
has_metadata
Method import_stops
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def import_stops
sorted_stops = source.stops.sort_by { |s| s.parent_station.present? ? 1 : 0 }
@stop_areas_id_by_registration_number = {}
CustomFieldsSupport.within_workgroup(workbench.workgroup) do
- 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
File stop_area.rb
has 537 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'geokit'
require 'geo_ruby'
module Chouette
class StopArea < Chouette::ActiveRecord
include StopAreaReferentialSupport
File vehicle_journey.rb
has 524 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Chouette
class VehicleJourney < Referential::Model
include CustomFieldsSupport
include TransportModeEnumerations