af83/chouette-core

View on GitHub

Showing 922 of 922 total issues

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

            edge: new Style({
                image: new Circle({
                    radius: 5,
                    stroke: new Stroke({ color: '#007fbb', width: 0.75 }),
                    fill: new Fill({ color: '#007fbb' })
Severity: Major
Found in app/packs/src/helpers/open_layers/styles.js and 3 other locations - About 1 hr to fix
app/packs/src/helpers/open_layers/styles.js on lines 76..82
app/packs/src/helpers/open_layers/styles.js on lines 83..89
app/packs/src/helpers/open_layers/styles.js on lines 91..97

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            default: new Style({
                image: new Circle({
                    radius: 5,
                    stroke: new Stroke({ color: '#007fbb', width: 0.75 }),
                    fill: new Fill({ color: '#ffffff' })
Severity: Major
Found in app/packs/src/helpers/open_layers/styles.js and 3 other locations - About 1 hr to fix
app/packs/src/helpers/open_layers/styles.js on lines 76..82
app/packs/src/helpers/open_layers/styles.js on lines 83..89
app/packs/src/helpers/open_layers/styles.js on lines 98..104

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        shapeWaypoint: new Style({
            image: new Circle({
                radius: 8,
                stroke: new Stroke({ color: 'white', width: 2 }),
                fill: new Fill({ color: 'red' })
Severity: Major
Found in app/packs/src/helpers/open_layers/styles.js and 3 other locations - About 1 hr to fix
app/packs/src/helpers/open_layers/styles.js on lines 83..89
app/packs/src/helpers/open_layers/styles.js on lines 91..97
app/packs/src/helpers/open_layers/styles.js on lines 98..104

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function mapDispatchToProps has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const mapDispatchToProps = (dispatch) => {
  return {
    onUpdateStartTimeFilter: (e, unit) =>{
      e.preventDefault()
      dispatch(actions.updateStartTimeFilter(e.target.value, unit))
Severity: Minor
Found in app/packs/src/vehicle_journeys/containers/Filters.js - About 1 hr to fix

    Function journeyPattern has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const journeyPattern = (state = {}, action) =>{
      switch (action.type) {
        case 'ADD_JOURNEYPATTERN':
          let stopPoints = window.stopPoints
    
    
    Severity: Minor
    Found in app/packs/src/journey_patterns/reducers/journeyPatterns.js - About 1 hr to fix

      Method import! has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def import!
              netex_source.service_journeys.each do |service_journey|
                decorator = Decorator.new(service_journey, day_types, index_route_journey_patterns, index_time_tables,
                                          code_builder: code_builder)
      
      
      Severity: Minor
      Found in app/models/import/netex_generic.rb - About 1 hr to fix

        Method simple_search_for has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def simple_search_for(search, index_path, save_search: true, graph_panel: :never, &block)
            if save_search
              if search.saved_search&.persisted?
                save_path = saved_search_path(search.saved_search)
                save_method = :patch
        Severity: Minor
        Found in app/helpers/simple_search_for_helper.rb - About 1 hr to fix

          Method map_stop_points has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def map_stop_points points
              (points&.includes(:stop_area) || []).map do |sp|
                {
                  :id => sp.stop_area.id,
                  :route_id => sp.try(:route_id),
          Severity: Minor
          Found in app/controllers/route_vehicle_journeys_controller.rb - About 1 hr to fix

            Function renderAssociatedFN has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              renderAssociatedFN() {
                if (this.footnotes().associated.length == 0) {
                  return <h3>{I18n.t('vehicle_journeys.vehicle_journeys_matrix.no_associated_footnotes')}</h3>
                } else {
                  return (

              Method aggregate! has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def aggregate!
                  Rails.logger.tagged("Aggregate ##{id}") do
                    measure 'aggregate', aggregate: id do
                      prepare_new
              
              
              Severity: Minor
              Found in app/models/aggregate.rb - About 1 hr to fix

                Method help_path has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def help_path
                    path = request.env['PATH_INFO']
                    target = case
                    when path.include?("/help")
                      ""
                Severity: Minor
                Found in app/helpers/application_helper.rb - About 1 hr to fix

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

                            <button className='btn btn-xs btn-link'
                                    disabled={actions.getSelected(vehicleJourneys).length == 0}
                                    onClick={onCancelSelection}>
                                    {I18n.t('vehicle_journeys.vehicle_journeys_matrix.cancel_selection')}
                            </button>
                  Severity: Major
                  Found in app/packs/src/vehicle_journeys/components/Tools.js and 1 other location - About 1 hr to fix
                  app/packs/src/vehicle_journeys/components/Tools.js on lines 70..74

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 59.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                                      {journeyPattern.shape?.id && (
                                        <div className='row'>
                                          <div className='col-xs-12 shape-map'>
                                            <ShapeMap shapeId={journeyPattern.shape.id} />
                                          </div>
                  Severity: Major
                  Found in app/packs/src/journey_patterns/components/EditModal.js and 1 other location - About 1 hr to fix
                  app/packs/src/journey_patterns/components/CreateModal.js on lines 123..129

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 59.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                                          {journeyPattern?.shape?.id && (
                                            <div className='row'>
                                              <div className='col-xs-12 shape-map'>
                                                <ShapeMap shapeId={journeyPattern.shape.id} />
                                              </div>
                  Severity: Major
                  Found in app/packs/src/journey_patterns/components/CreateModal.js and 1 other location - About 1 hr to fix
                  app/packs/src/journey_patterns/components/EditModal.js on lines 133..139

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 59.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                            <button className='btn btn-xs btn-link pull-right'
                                    disabled={actions.getSelectedDeletables(vehicleJourneys).length == 0}
                                    onClick={onCancelDeletion}>
                                    {I18n.t('vehicle_journeys.vehicle_journeys_matrix.cancel_destroy')}
                            </button>
                  Severity: Major
                  Found in app/packs/src/vehicle_journeys/components/Tools.js and 1 other location - About 1 hr to fix
                  app/packs/src/vehicle_journeys/components/Tools.js on lines 65..69

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 59.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Method state_update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def self.state_update route, state
                        objects = []
                        transaction do
                          state.each do |item|
                            item.delete('errors')
                  Severity: Minor
                  Found in app/models/chouette/vehicle_journey.rb - About 1 hr to fix

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

                        if(this.props.status.isFetching == true) {
                          return (
                            <div className="isLoading" style={{marginTop: 80, marginBottom: 80}}>
                              <div className="loader"></div>
                            </div>
                    app/packs/src/routes/components/App.js on lines 24..41
                    app/packs/src/time_tables/components/Timetable.js on lines 23..101
                    app/packs/src/vehicle_journeys/components/VehicleJourneysList.js on lines 173..285

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 58.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                        if (this.props.isFetching) {
                          return (
                            <div className="isLoading" style={{marginTop: 80, marginBottom: 80}}>
                              <div className="loader"></div>
                            </div>
                    Severity: Major
                    Found in app/packs/src/routes/components/App.js and 3 other locations - About 1 hr to fix
                    app/packs/src/journey_patterns/components/JourneyPatterns.js on lines 77..159
                    app/packs/src/time_tables/components/Timetable.js on lines 23..101
                    app/packs/src/vehicle_journeys/components/VehicleJourneysList.js on lines 173..285

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 58.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                        if(this.props.status.isFetching == true) {
                          return (
                            <div className="isLoading" style={{marginTop: 80, marginBottom: 80}}>
                              <div className="loader"></div>
                            </div>
                    app/packs/src/journey_patterns/components/JourneyPatterns.js on lines 77..159
                    app/packs/src/routes/components/App.js on lines 24..41
                    app/packs/src/time_tables/components/Timetable.js on lines 23..101

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 58.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                        if(this.props.status.isFetching == true) {
                          return (
                            <div className="isLoading" style={{marginTop: 80, marginBottom: 80}}>
                              <div className="loader"></div>
                            </div>
                    Severity: Major
                    Found in app/packs/src/time_tables/components/Timetable.js and 3 other locations - About 1 hr to fix
                    app/packs/src/journey_patterns/components/JourneyPatterns.js on lines 77..159
                    app/packs/src/routes/components/App.js on lines 24..41
                    app/packs/src/vehicle_journeys/components/VehicleJourneysList.js on lines 173..285

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 58.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language