af83/chouette-core

View on GitHub

Showing 935 of 935 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
Severity: Minor
Found in app/models/merge/referential/legacy.rb - About 5 days to fix

File netex_generic.rb has 1821 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
Severity: Major
Found in app/models/export/netex_generic.rb - About 4 days to fix

    File gtfs.rb has 1489 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]
     
     
    Severity: Major
    Found in app/models/import/gtfs.rb - About 3 days to fix

      File gtfs.rb has 1352 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
      Severity: Major
      Found in app/models/export/gtfs.rb - About 3 days to fix

        File netex_generic.rb has 1117 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module Import
        class NetexGeneric < Import::Base
        include LocalImportSupport
        include Imports::WithoutReferentialSupport
         
         
        Severity: Major
        Found in app/models/import/netex_generic.rb - About 2 days to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          <div>
          <div className={'form-group date ' + (modal.modalProps.error ? ' has-error' : '')}>
          <div className="form-inline">
          <select value={formatNumber(modal.modalProps.begin.day)} onChange={(e) => onUpdatePeriodForm(e, 'begin', 'day', modal.modalProps)} id="q_validity_period_begin_gteq_3i" className="date required form-control">
          {makeDaysOptions(modal.modalProps.begin.day)}
          Severity: Major
          Found in app/packs/src/time_tables/components/PeriodForm.js and 1 other location - About 1 day to fix
          app/packs/src/time_tables/components/PeriodForm.js on lines 86..100

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          <div>
          <div className={'form-group date ' + (modal.modalProps.error ? ' has-error' : '')}>
          <div className="form-inline">
          <select value={formatNumber(modal.modalProps.end.day)} onChange={(e) => onUpdatePeriodForm(e, 'end', 'day', modal.modalProps)} id="q_validity_period_end_gteq_3i" className="date required form-control">
          {makeDaysOptions(modal.modalProps.end.day)}
          Severity: Major
          Found in app/packs/src/time_tables/components/PeriodForm.js and 1 other location - About 1 day to fix
          app/packs/src/time_tables/components/PeriodForm.js on lines 71..85

          actions has 96 functions (exceeds 20 allowed). Consider refactoring.
          Open

          const actions = {
          enterEditMode: () => ({
          type: "ENTER_EDIT_MODE"
          }),
          exitEditMode: () => ({
          Severity: Major
          Found in app/packs/src/vehicle_journeys/actions/index.js - About 1 day to fix

            Class Referential has 91 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Referential < ApplicationModel
            prepend ReferentialSaveWithLock
             
            include DataFormatEnumerations
            include ObjectidFormatterSupport
            Severity: Major
            Found in app/models/referential.rb - About 1 day to fix

              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
              Severity: Major
              Found in app/models/merge/referential/legacy.rb - About 1 day to fix

                File base.rb has 674 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module Search
                class Base
                extend ActiveModel::Naming
                extend Enumerize
                 
                 
                Severity: Major
                Found in app/lib/search/base.rb - About 1 day to fix

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                  module Options
                  extend ActiveSupport::Concern
                   
                  included do
                  option :target_model
                  Severity: Major
                  Found in app/models/control/presence_attribute.rb and 1 other location - About 1 day to fix
                  app/models/control/absence_attribute.rb on lines 6..135

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                  module Options
                  extend ActiveSupport::Concern
                   
                  included do
                  option :target_model
                  Severity: Major
                  Found in app/models/control/absence_attribute.rb and 1 other location - About 1 day to fix
                  app/models/control/presence_attribute.rb on lines 6..139

                  Class StopArea has 76 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class StopArea < Chouette::ActiveRecord
                  include StopAreaReferentialSupport
                   
                  has_metadata
                  include ProjectionFields
                  Severity: Major
                  Found in app/models/chouette/stop_area.rb - About 1 day to fix

                    File referential.rb has 638 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
                    Severity: Major
                    Found in app/models/referential.rb - About 1 day to fix

                      File index.js has 616 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { batchActions } from '../batch'
                       
                      const actions = {
                      enterEditMode: () => ({
                      type: "ENTER_EDIT_MODE"
                      Severity: Major
                      Found in app/packs/src/vehicle_journeys/actions/index.js - About 1 day to fix

                        Method attribute has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def attribute(attribute_name, options = {})
                        resource = options[:object] || object
                         
                        if options.key?(:value)
                        raw_value = options[:value]
                        Severity: Minor
                        Found in app/helpers/simple_block_for_helper.rb - About 1 day to fix

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        <div className='flex time filter_menu-item'>
                        <label className='control-label time'>{I18n.t("vehicle_journeys.form.departure_range.end")}</label>
                        <div className='form-inline'>
                        <div className='input-group time'>
                        <input
                        Severity: Major
                        Found in app/packs/src/vehicle_journeys/components/Filters.js and 1 other location - About 1 day to fix
                        app/packs/src/vehicle_journeys/components/Filters.js on lines 78..101

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        <div className='flex time filter_menu-item mr-5'>
                        <label className='control-label time'>{I18n.t("vehicle_journeys.form.departure_range.start")}</label>
                        <div className='form-inline'>
                        <div className='input-group time'>
                        <input
                        Severity: Major
                        Found in app/packs/src/vehicle_journeys/components/Filters.js and 1 other location - About 1 day to fix
                        app/packs/src/vehicle_journeys/components/Filters.js on lines 102..125

                        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
                        Severity: Minor
                        Found in app/helpers/table_builder_helper.rb - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language