tools/contributed/sumopy/plugins/prt/prt-31-decompok.py

Summary

Maintainability
F
10 mos
Test Coverage

File prt-31-decompok.py has 2945 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
Severity: Major
Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 wk to fix

    Function process_step has a Cognitive Complexity of 139 (exceeds 5 allowed). Consider refactoring.
    Open

        def process_step(self, process):
            simtime = process.simtime
            print 79*'_'
            print 'PrtStops.process_step at', simtime
            net = self.get_scenario().net
    Severity: Minor
    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 2 days to fix

    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 process_step has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
    Open

        def process_step(self, process):
            simtime = process.simtime
            print 79*'_'
            print 'Deompressors.process_step at', simtime
            net = self.get_scenario().net
    Severity: Minor
    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 2 days to fix

    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 process_step has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
    Open

        def process_step(self, process):
            simtime = process.simtime
            print 79*'_'
            print 'Compressors.process_step at', simtime
            net = self.get_scenario().net
    Severity: Minor
    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 day to fix

    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 process_step has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

        def process_step(self, process):
            simtime = process.simtime
            print 79*'_'
            print 'Mergenodes.process_step at', simtime
            net = self.get_scenario().net
    Severity: Minor
    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 day to fix

    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 make_from_net has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

        def make_from_net(self):
            """
            Make merge node database from network.
            """
            print 'Mergenodes.make_from_net'
    Severity: Minor
    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 day to fix

    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 enter_veh has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        def enter_veh(self, id_veh, id_veh_sumo, id_merge_from, id_merge_to, id_edge_merge_sumo, vehicles):
            print 'enter_veh id_veh %s, id_merge_from %d to id_merge_to %d' % (id_veh_sumo, id_merge_from, id_merge_to)
    
            # in id_merge_from: take vehicle out of merged queue and input queue
    
    
    Severity: Minor
    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 6 hrs to fix

    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

    PrtVehicles has 39 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class PrtVehicles(am.ArrayObjman):
    
        def __init__(self, ident, prtservices, **kwargs):
            # print 'PrtVehicles vtype id_default',vtypes.ids_sumo.get_id_from_index('passenger1')
            self._init_objman(ident=ident,
    Severity: Minor
    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 5 hrs to fix

      Function search_downstream_merges has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          def search_downstream_merges(self, id_edge_start, edges, lanes, id_prtmode, ids_sinkedge=set()):
              """
              Searches next downstream merge nodes.
              Returns array of downstream merge node IDs
      
      
      Severity: Minor
      Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 4 hrs to fix

      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 make_times_stop_to_stop has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def make_times_stop_to_stop(self, fstar=None, times=None):
              print 'make_times_stop_to_stop'
              log = self.get_logger()
              if fstar is None:
                  if self.fstar is None:
      Severity: Minor
      Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 3 hrs to fix

      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

      PrtStops has 30 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class PrtStops(am.ArrayObjman):
          def __init__(self, ident, prtservices, **kwargs):
              self._init_objman(ident=ident,
                                parent=prtservices,
                                name='PRT stops',
      Severity: Minor
      Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 3 hrs to fix

        Function program_leadveh has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def program_leadveh(self, id_stop, id_veh, id_stop_target, time_start):
                print 'program_leadveh prt.%d  from id_stop %d to id_stop_target %d at %d' % (
                    id_veh, id_stop, id_stop_target, time_start), 'check leader', id_veh == self.ids_veh_lead[id_stop]
        
                # check also if occupied in the meanwhile?? need to know emptytrip or not...
        Severity: Minor
        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 2 hrs to fix

        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 prepare_sim has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            def prepare_sim(self, process):
                print 'PrtStops.prepare_sim'
                net = self.get_scenario().net
                ptstops = net.ptstops
                ids_edge_sumo = net.edges.ids_sumo
        Severity: Minor
        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 2 hrs to fix

        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 process_step has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def process_step(self, process):
                simtime = process.simtime
                print 79*'_'
                print 'PrtVehicles.process_step at', simtime
                net = self.get_scenario().net
        Severity: Minor
        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 2 hrs to fix

        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 start_vehicles_platoon has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def start_vehicles_platoon(self, id_stop, process, timeout_platoon=40, n_platoon_max=8):
                # print 'start_vehicles_platoon id_stop, times_plat_accumulate',id_stop,self.times_plat_accumulate[id_stop]
                # print '  ids_vehs_prog=\n',self.ids_vehs_prog[id_stop]
        
                if self.times_plat_accumulate[id_stop] < 0:
        Severity: Minor
        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

        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 search_upstream_merge has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def search_upstream_merge(self, id_edge_start, edges, lanes, id_prtmode, ids_mainline=set()):
                """
                Searches next upstream merge node.
                Returns id_node, length to node
        
        
        Severity: Minor
        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

        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 prepare_sim has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def prepare_sim(self, process):
                print 'PrtStops.prepare_sim'
                net = self.get_scenario().net
                ptstops = net.ptstops
                ids_edge_sumo = net.edges.ids_sumo
        Severity: Minor
        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

          Function exit_veh has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def exit_veh(self, id_veh, id_veh_sumo, id_merge_from, vehicles, is_remove_from_control=False):
                  print 'exit_veh id_veh %s, id_merge_from %d ' % (id_veh_sumo, id_merge_from)
          
                  # in id_merge_from: take vehicle out of merged queue and input queue
          
          
          Severity: Minor
          Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

          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 plan has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def plan(self, ids_person, logger=None):
                  """
                  Generates a plan for these person according to this strategie.
                  Overriden by specific strategy.
                  """
          Severity: Minor
          Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

            Function get_fstar has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_fstar(self):
                    """
                    Returns the forward star graph of the network as dictionary:
                        fstar[id_fromedge] = set([id_toedge1, id_toedge2,...])
                    """
            Severity: Minor
            Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

            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 prepare_sim has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def prepare_sim(self, process):
                    print 'PrtVehicles.prepare_sim'
                    if len(self) == 0:
                        return []
            
            
            Severity: Minor
            Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

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

                  def process_step(self, process):
                      simtime = process.simtime
                      print 79*'_'
                      print 'PrtVehicles.process_step at', simtime
                      net = self.get_scenario().net
              Severity: Minor
              Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

                Function start_vehicles has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    def start_vehicles(self, id_stop, process):
                        # print 'start_vehicles=\n',self.ids_vehs_prog[id_stop]
                        i = 0
                        vehicles = self.parent.prtvehicles
                        ids_vehs_prog = self.ids_vehs_prog[id_stop]
                Severity: Minor
                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

                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 prepare_sim has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    def prepare_sim(self, process):
                        print 'Mergenodes.prepare_sim'
                        net = self.get_scenario().net
                        nodes = net.nodes
                        edges = net.edges
                Severity: Minor
                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

                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 _alloc_queue has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _alloc_queue(self, queue, queue_alloc, capa_queue,
                Severity: Major
                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 1 hr to fix

                  Function decatenate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def decatenate(self, id_veh):
                          print 'decatenate prt.%d' % id_veh
                  
                          id_leader = self.ids_leader[id_veh]
                          print '  id_leader', id_leader
                  Severity: Minor
                  Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 55 mins to fix

                  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 _alloc_queue_follower has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def _alloc_queue_follower(self, queue, queue_alloc, capa_queue,
                  Severity: Major
                  Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 50 mins to fix

                    Function _alloc_queue has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def _alloc_queue(self, queue, queue_alloc, capa_queue,
                    Severity: Major
                    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 50 mins to fix

                      Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(self, ident, results, prtstops,
                      Severity: Minor
                      Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                        Function make has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def make(self, id_stop, position_from=None, position_to=None,
                        Severity: Minor
                        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                          Function enter_veh has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def enter_veh(self, id_veh, id_veh_sumo, id_merge_from, id_merge_to, id_edge_merge_sumo, vehicles):
                          Severity: Minor
                          Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                            Function append_stage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def append_stage(self, id_plan, time_start=-1.0,
                            Severity: Minor
                            Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if vehicles.reached_stop_sumo(id_veh_sumo):
                                                          ids_veh_arrived.append(id_veh)
                                                  for id_veh in ids_veh_arrived:
                              Severity: Major
                              Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                Function plan has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def plan(self, ids_person, logger=None):
                                        """
                                        Generates a plan for these person according to this strategie.
                                        Overriden by specific strategy.
                                        """
                                Severity: Minor
                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                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

                                Avoid deeply nested control flow statements.
                                Open

                                                        for ind_queue, queue, is_avail, capa in zip(range(n_queues), queues, are_queue_avail, capacities):
                                                            dl = (capa - len(queue)) * self.length_veh - length_plat
                                                            if (dl > 0) & is_avail:
                                                                costs[ind_queue] = dl
                                                            else:
                                Severity: Major
                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if lineinds_vehs_merged[ind_insert-1] != lineind:
                                                              id_ghost = ids_vehs_merged[ind_insert-1]  # last veh in queue
                                                              vehicles.add_ghost(id_veh, id_ghost, dist_tomerge_new, dist)
                                  
                                  
                                  Severity: Major
                                  Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if lineinds_vehs_merged[ind_insert-1] != lineind:
                                                                vehicles.add_ghost(id_veh, id_ghost2, dist_tomerge_new, dist)
                                    
                                    
                                    Severity: Major
                                    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if id_berth_board >= 0:
                                                                  # print '     send vehicle id_veh %d to id_berth_board %d'%(id_veh,id_berth_board)#,berths.stoppositions[id_berth_board]
                                                                  n_veh_alloc -= 1
                                                                  berths.ids_veh[id_berth_alight] = -1
                                      
                                      
                                      Severity: Major
                                      Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                        Function push_empty_leadvehs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def push_empty_leadvehs(self, ids_veh_lead, process):
                                                n_timeslot_offset = 3
                                                stops = self.get_stops()
                                                vehicles = self.get_vehicles()
                                                inds_valid = np.flatnonzero(vehicles.states[ids_veh_lead] == VEHICLESTATES['emptytrip'])
                                        Severity: Minor
                                        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                        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

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if id_edge1 in ids_mainlinedges:
                                                                    id_edge = id_edge1
                                                                else:
                                                                    id_edge = id_edge2
                                        
                                        
                                        Severity: Major
                                        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if id_person_sumo is not None:
                                                                      # do some statistics here
                                                                      self.waittimes_tot[id_stop] -= simtime - self.waittimes_persons[id_stop][id_person_sumo]
                                                                      del self.waittimes_persons[id_stop][id_person_sumo]
                                                                      self.numbers_person_wait[id_stop] -= 1
                                          Severity: Major
                                          Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                    if len(inds_queue) > 0:
                                                                        #ind_queue = ids_edge_sumo_target.index(id_targetedge_sumo)
                                                                        ind_queue = inds_queue[0]
                                                                        queue = queues[ind_queue]
                                                                        capa_queue = capacities[ind_queue]
                                            Severity: Major
                                            Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                      if not set(self.ids_vehs[id_stop][:ind]).isdisjoint(self.ids_vehs_alight_allocated[id_stop]):
                                                                          # print '      allocated veh in front! Stop forwarding'
                                                                          break
                                              
                                                                      elif vehicles.is_completed_alighting(id_veh):
                                              Severity: Major
                                              Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                        if ((len_queue == capacity) | ((simtime - releasetime_queue) > 15)) & (simtime - self.releasetimes[id_comp] > 10):
                                                                            # queue is full
                                                
                                                                            # action 1
                                                                            # platoon all vehicles in queue, starting from last in queue
                                                Severity: Major
                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                          for i in range(len(queue_alloc)):
                                                                              id_veh, id_targetedge_sumo = queue_alloc[i]
                                                                              if vehicles.reached_stop_sumo(vehicles.ids_sumo[id_veh]):
                                                                                  id_veh_arrived = id_veh
                                                                                  ind_pl_alloc = i
                                                  Severity: Major
                                                  Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                            if id_type != id_zippertype:
                                                                                print 'WARNING: PRT network node %d %s is NOT in zipper mode!' % (
                                                                                    id_node, nodes.ids_sumo[id_node])
                                                    
                                                    
                                                    Severity: Major
                                                    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                              if len(ids_downedge_incoming) == 2:
                                                                                  ids_lane1, ids_lane2 = edges.ids_lanes[ids_downedge_incoming]
                                                                                  al1 = lanes.get_accesslevel(ids_lane1, id_prtmode)
                                                                                  al2 = lanes.get_accesslevel(ids_lane2, id_prtmode)
                                                                                  # print '      check al1,al2',al1,al2,(al1 == 2) & (al2 == 2)
                                                      Severity: Major
                                                      Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                if ids_node_out is not None:
                                                                                    # print '  check which out mergenode are on the current route of the vehicle'
                                                        
                                                                                    # exit from previous merge
                                                                                    self.exit_veh(id_veh, id_veh_sumo, id_merge, vehicles)
                                                        Severity: Major
                                                        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                                  if lineinds_vehs_merged[ind_insert] != lineind:
                                                                                      vehicles.add_ghost(id_ghost1, id_veh, dist_last, dist_tomerge_new)
                                                          
                                                          
                                                          Severity: Major
                                                          Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                    if len(id_edge_sumo_dests) > 0:
                                                                                        # check if next trip has origin edge equal to edge of this stop
                                                                                        if id_edge_sumo_dests[0][2] == id_edge_sumo:
                                                                                            # print '  add to waittimes_persons',id_person_sumo
                                                                                            self.waittimes_persons[id_stop][id_person_sumo] = simtime
                                                            Severity: Major
                                                            Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                      if not ids_shuntedges.isdisjoint(ids_edge_from):
                                                                                          print '    one incoming edge is  a shunt edge. Detect last shunt node.'
                                                              
                                                                                          # TODO: this should be a function of te compressor class
                                                                                          id_tonode_out = edges.ids_tonode[ids_edge_to[0]]
                                                              Severity: Major
                                                              Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                        if id_veh_arrived > -1:
                                                                                            # a platoon leader  id_veh_arrived has arrived
                                                                
                                                                                            # check if entire platoon arrived at the queue
                                                                                            length_plat = vehicles.lengths_plat[id_veh_arrived]
                                                                Severity: Major
                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                          if (al1 == 1) & (al2 == 2):
                                                                                              print '      +share access level on outedge 1'
                                                                                              ids_node_out = self.search_downstream_merges(
                                                                                                  id_edge2, edges, lanes, id_prtmode, ids_sinkedge=ids_shuntedges)
                                                                                              self.add_row(ids_node=id_node,
                                                                  Severity: Major
                                                                  Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                            if not is_found_queue:
                                                                                                # print '      no queue with target or specific queue is full, search for a new queue'
                                                                    
                                                                                                is_found_queue = False
                                                                                                for ind_queue, queue in zip(range(1, n_queues), queues[1:]):
                                                                    Severity: Major
                                                                    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                              if not is_merge:  # len(ids_downedge_incoming) == 1:
                                                                                                  #ids_lane = edges.ids_lanes[ids_downedge_incoming]
                                                                                                  # if lanes.get_accesslevel(ids_lane1, id_prtmode) == 2:
                                                                                                  ids_edge_new.add(id_downedge)
                                                                      
                                                                      
                                                                      Severity: Major
                                                                      Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                                        Function allocate_board has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                        Open

                                                                            def allocate_board(self, id_stop, n_alloc, queues):
                                                                                """
                                                                                Return successive berth ID to be allocated for boarding
                                                                                at given stop ID.
                                                                                n_alloc is the number of vehicles which remain to be 
                                                                        Severity: Minor
                                                                        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                                        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

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                                for ind_queue, queue, capa_queue, in zip(range(n_queues), queues, capacities):
                                                                                                    if id_platoonleader in queue:
                                                                                                        self._alloc_queue_follower(
                                                                                                            queue, queues_alloc[ind_queue],
                                                                                                            capa_queue,
                                                                        Severity: Major
                                                                        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 45 mins to fix

                                                                          Function search_downstream_merges has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                          Open

                                                                              def search_downstream_merges(self, id_edge_start, edges, lanes, id_prtmode, ids_sinkedge=set()):
                                                                          Severity: Minor
                                                                          Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                            Function exit_veh has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                            Open

                                                                                def exit_veh(self, id_veh, id_veh_sumo, id_merge_from, vehicles, is_remove_from_control=False):
                                                                            Severity: Minor
                                                                            Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                              Function control_stop_alight has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                              Open

                                                                                  def control_stop_alight(self, id_veh, id_stop, id_berth,
                                                                              Severity: Minor
                                                                              Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                                Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                Open

                                                                                    def __init__(self, ident, parent=None,
                                                                                Severity: Minor
                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                                  Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                  Open

                                                                                      def __init__(self, ident, simulation=None,
                                                                                  Severity: Minor
                                                                                  Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                                    Function control_stop_board has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                    Open

                                                                                        def control_stop_board(self, id_veh, id_stop, id_berth,
                                                                                    Severity: Minor
                                                                                    Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                                      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                      Open

                                                                                          def __init__(self, ident, stages,
                                                                                      Severity: Minor
                                                                                      Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                                        Function search_upstream_merge has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                        Open

                                                                                            def search_upstream_merge(self, id_edge_start, edges, lanes, id_prtmode, ids_mainline=set()):
                                                                                        Severity: Minor
                                                                                        Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                                          Function init_trip_empty has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                          Open

                                                                                              def init_trip_empty(self, id_stop, id_berth, id_veh, simtime, is_ask_vehman=True):
                                                                                          Severity: Minor
                                                                                          Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                                            Function init_trip_occupied has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                            Open

                                                                                                def init_trip_occupied(self, id_stop, id_berth, id_veh, id_veh_sumo, simtime):
                                                                                            Severity: Minor
                                                                                            Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                                              Function del_ghosts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                              Open

                                                                                                  def del_ghosts(self, id_veh, id_ghost):
                                                                                                      if self.ids_ghosts[id_veh][0] == -1:
                                                                                                          # id_veh has no ghosts
                                                                                                          return
                                                                                                      else:
                                                                                              Severity: Minor
                                                                                              Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 35 mins to fix

                                                                                              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

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                      return True
                                                                                              Severity: Major
                                                                                              Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 30 mins to fix

                                                                                                Function _trigger_platoon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                Open

                                                                                                    def _trigger_platoon(self, id_stop, inds_platoon):
                                                                                                        # print 'trigger_platoon inds_platoon',inds_platoon
                                                                                                        ids_vehs_prog = self.ids_vehs_prog[id_stop]
                                                                                                        self.times_plat_accumulate[id_stop] = -1
                                                                                                
                                                                                                
                                                                                                Severity: Minor
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 25 mins to fix

                                                                                                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 add_to_net has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                Open

                                                                                                    def add_to_net(self, n=-1, length_veh_av=4.0):
                                                                                                        """
                                                                                                        Add n PRT vehicles to network
                                                                                                        If n = -1 then fill up stops with vehicles.
                                                                                                        """
                                                                                                Severity: Minor
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 25 mins to fix

                                                                                                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 try_set_leadveh has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                Open

                                                                                                    def try_set_leadveh(self, id_stop, id_veh):
                                                                                                
                                                                                                        if self.ids_veh_lead[id_stop] >= 0:
                                                                                                            # print 'try_set_leadveh leader already defined',id_stop,id_veh,self.ids_veh_lead[id_stop]
                                                                                                            return False
                                                                                                Severity: Minor
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 25 mins to fix

                                                                                                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 is_completed_alighting has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                Open

                                                                                                    def is_completed_alighting(self, id_veh):
                                                                                                        # print 'is_completed_alighting',self.get_id_sumo(id_veh),self.states[id_veh],self.states[id_veh] == VEHICLESTATES['alighting'],traci.vehicle.getPersonNumber(self.get_id_sumo(id_veh)),type(traci.vehicle.getPersonNumber(self.get_id_sumo(id_veh)))
                                                                                                        if self.states[id_veh] == VEHICLESTATES['alighting']:
                                                                                                            if traci.vehicle.getPersonNumber(self.get_id_sumo(id_veh)) == 0:
                                                                                                                # print '  id_veh_sumo',self.get_id_sumo(id_veh),'completed alighting'
                                                                                                Severity: Minor
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py - About 25 mins to fix

                                                                                                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

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

                                                                                                class PrtStops(am.ArrayObjman):
                                                                                                    def __init__(self, ident, prtservices, **kwargs):
                                                                                                        self._init_objman(ident=ident,
                                                                                                                          parent=prtservices,
                                                                                                                          name='PRT stops',
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 2 mos to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 826..1945

                                                                                                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 7406.

                                                                                                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

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

                                                                                                class VehicleMan(am.ArrayObjman):
                                                                                                    def __init__(self, ident, prtservices, **kwargs):
                                                                                                        self._init_objman(ident=ident,
                                                                                                                          parent=prtservices,
                                                                                                                          name='PRT vehicle management',
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 1 mo to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3920..4440

                                                                                                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 3682.

                                                                                                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

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

                                                                                                class PrtService(SimobjMixin, DemandobjMixin, cm.BaseObjman):
                                                                                                    def __init__(self, ident, simulation=None,
                                                                                                                 name='PRT service', info='PRT service',
                                                                                                                 **kwargs):
                                                                                                            # print 'PrtService.__init__',name
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 2 other locations - About 3 wks to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 4443..4880
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 4497..4934

                                                                                                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 2238.

                                                                                                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

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

                                                                                                class PrtStrategy(StrategyMixin):
                                                                                                    def __init__(self, ident, parent=None,
                                                                                                                 name='Personal Rapid Transit Strategy',
                                                                                                                 info='With this strategy, the person uses Personla Rapid Transit as main transport mode.',
                                                                                                                 **kwargs):
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 10 other locations - About 2 wks to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-23-newversionok.py on lines 1658..1918
                                                                                                tools/contributed/sumopy/plugins/prt/prt-24-mergemake.py on lines 1910..2170
                                                                                                tools/contributed/sumopy/plugins/prt/prt-25-oldmergenode.py on lines 2172..2432
                                                                                                tools/contributed/sumopy/plugins/prt/prt-26-stationproblem.py on lines 2405..2665
                                                                                                tools/contributed/sumopy/plugins/prt/prt-27-simplemergeok.py on lines 2366..2626
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 2569..2829
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 2694..2954
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2688..2948
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3571..3831
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3625..3885

                                                                                                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 1429.

                                                                                                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

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

                                                                                                    def process_step(self, process):
                                                                                                        simtime = process.simtime
                                                                                                        print 79*'_'
                                                                                                        print 'PrtVehicles.process_step at', simtime
                                                                                                        net = self.get_scenario().net
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 1 wk to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3031..3160

                                                                                                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 1044.

                                                                                                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

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

                                                                                                    def make_from_net(self):
                                                                                                        """
                                                                                                        Make merge node database from network.
                                                                                                        """
                                                                                                        print 'Mergenodes.make_from_net'
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 1 wk to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 809..994

                                                                                                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 1037.

                                                                                                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

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

                                                                                                    def prepare_sim(self, process):
                                                                                                        print 'Compressors.prepare_sim'
                                                                                                        net = self.get_scenario().net
                                                                                                        nodes = net.nodes
                                                                                                        edges = net.edges
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 6 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 138..206
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 138..206
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 146..214

                                                                                                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 630.

                                                                                                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

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

                                                                                                    def process_step(self, process):
                                                                                                        simtime = process.simtime
                                                                                                        print 79*'_'
                                                                                                        print 'Mergenodes.process_step at', simtime
                                                                                                        net = self.get_scenario().net
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 5 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 1081..1198
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 1125..1242
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 1142..1259

                                                                                                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 588.

                                                                                                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 6 locations. Consider refactoring.
                                                                                                Open

                                                                                                    def prepare_sim(self, process):
                                                                                                        print 'PrtVehicles.prepare_sim'
                                                                                                        if len(self) == 0:
                                                                                                            return []
                                                                                                
                                                                                                
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 5 other locations - About 5 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 2090..2148
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2084..2142
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 2903..2961
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 2947..3005
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 3000..3058

                                                                                                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 573.

                                                                                                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

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

                                                                                                    def prepare_sim(self, process):
                                                                                                        print 'Decompressors.prepare_sim'
                                                                                                        net = self.get_scenario().net
                                                                                                        nodes = net.nodes
                                                                                                        edges = net.edges
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 5 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 416..484

                                                                                                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 566.

                                                                                                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

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

                                                                                                class Stopresults(am.ArrayObjman):
                                                                                                    def __init__(self, ident, results, prtstops,
                                                                                                                 name='Stop results',
                                                                                                                 info='Table with simulation results of stops generated from vehicle management.',
                                                                                                                 **kwargs):
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 11 other locations - About 5 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-23-newversionok.py on lines 2946..3029
                                                                                                tools/contributed/sumopy/plugins/prt/prt-24-mergemake.py on lines 3199..3282
                                                                                                tools/contributed/sumopy/plugins/prt/prt-25-oldmergenode.py on lines 3463..3546
                                                                                                tools/contributed/sumopy/plugins/prt/prt-26-stationproblem.py on lines 3696..3779
                                                                                                tools/contributed/sumopy/plugins/prt/prt-27-simplemergeok.py on lines 3657..3740
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 3863..3946
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 3988..4071
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 3992..4075
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 4884..4967
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 4938..5021
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 5045..5128

                                                                                                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 523.

                                                                                                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

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

                                                                                                class PrtBerths(am.ArrayObjman):
                                                                                                
                                                                                                    def __init__(self, ident, prtstops, **kwargs):
                                                                                                        # print 'PrtVehicles vtype id_default',vtypes.ids_sumo.get_id_from_index('passenger1')
                                                                                                        self._init_objman(ident=ident,
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 10 other locations - About 4 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-23-newversionok.py on lines 66..150
                                                                                                tools/contributed/sumopy/plugins/prt/prt-24-mergemake.py on lines 318..402
                                                                                                tools/contributed/sumopy/plugins/prt/prt-25-oldmergenode.py on lines 581..665
                                                                                                tools/contributed/sumopy/plugins/prt/prt-26-stationproblem.py on lines 717..801
                                                                                                tools/contributed/sumopy/plugins/prt/prt-27-simplemergeok.py on lines 678..762
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 723..807
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 736..820
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 736..820
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 1503..1587
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 1547..1631

                                                                                                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 475.

                                                                                                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

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

                                                                                                    def exit_veh(self, id_veh, id_veh_sumo, id_merge_from, vehicles, is_remove_from_control=False):
                                                                                                        print 'exit_veh id_veh %s, id_merge_from %d ' % (id_veh_sumo, id_merge_from)
                                                                                                
                                                                                                        # in id_merge_from: take vehicle out of merged queue and input queue
                                                                                                
                                                                                                
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 4 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 1201..1260
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 1245..1304
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 1262..1321

                                                                                                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 437.

                                                                                                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

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

                                                                                                class PrtTransits(StageTypeMixin):
                                                                                                    def __init__(self, ident, stages,
                                                                                                                 name='Ride on PRT',
                                                                                                                 info='Ride on Personal Rapid Transit network.',
                                                                                                                 # **kwargs,
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 11 other locations - About 4 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-23-newversionok.py on lines 1921..2004
                                                                                                tools/contributed/sumopy/plugins/prt/prt-24-mergemake.py on lines 2173..2256
                                                                                                tools/contributed/sumopy/plugins/prt/prt-25-oldmergenode.py on lines 2435..2518
                                                                                                tools/contributed/sumopy/plugins/prt/prt-26-stationproblem.py on lines 2668..2751
                                                                                                tools/contributed/sumopy/plugins/prt/prt-27-simplemergeok.py on lines 2629..2712
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 2832..2915
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 2957..3040
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2951..3034
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3834..3917
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3888..3971
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 3981..4064

                                                                                                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 413.

                                                                                                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

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

                                                                                                            if True:  # do this later ...simtime - self.releasetimes[id_comp]> 10:
                                                                                                                # now check if any of the vehicle in any of the queues has arrived
                                                                                                                # and if a queue is complete, create a platoon, send it off and
                                                                                                                # reset the queue
                                                                                                                # print '  Deal with queues...'
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 3 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 343..391

                                                                                                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 348.

                                                                                                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

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

                                                                                                    def search_downstream_merges(self, id_edge_start, edges, lanes, id_prtmode, ids_sinkedge=set()):
                                                                                                        """
                                                                                                        Searches next downstream merge nodes.
                                                                                                        Returns array of downstream merge node IDs
                                                                                                
                                                                                                
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 3 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 1440..1500
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 1484..1544
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 1501..1561

                                                                                                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 318.

                                                                                                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

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

                                                                                                    def decatenate(self, id_veh):
                                                                                                        print 'decatenate prt.%d' % id_veh
                                                                                                
                                                                                                        id_leader = self.ids_leader[id_veh]
                                                                                                        print '  id_leader', id_leader
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 2 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3225..3264

                                                                                                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 297.

                                                                                                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

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

                                                                                                    def search_upstream_merge(self, id_edge_start, edges, lanes, id_prtmode, ids_mainline=set()):
                                                                                                        """
                                                                                                        Searches next upstream merge node.
                                                                                                        Returns id_node, length to node
                                                                                                
                                                                                                
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 2 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 1397..1438

                                                                                                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 282.

                                                                                                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

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

                                                                                                    def _init_attributes(self):
                                                                                                        vtypes = self.get_scenario().demand.vtypes
                                                                                                        net = self.get_scenario().net
                                                                                                
                                                                                                        self.add(cm.AttrConf('time_update', 0.5,
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 6 other locations - About 2 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 1940..1992
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 1989..2041
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 1983..2035
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 2794..2846
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 2838..2890
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 2879..2931

                                                                                                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 259.

                                                                                                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 3 locations. Consider refactoring.
                                                                                                Open

                                                                                                    def concatenate(self, id_veh, id_veh_pre):
                                                                                                        print 'concatenate prt.%d' % id_veh, 'prt.%d' % id_veh_pre
                                                                                                        self.ids_leader[id_veh] = id_veh_pre
                                                                                                        self.ids_follower[id_veh_pre] = id_veh
                                                                                                
                                                                                                
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 2 other locations - About 2 days to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2352..2374
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3187..3209

                                                                                                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 219.

                                                                                                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

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

                                                                                                                    if (length_plat > 0.001) & (id_leader == -1):
                                                                                                                        # vehicle is a platoon leader:
                                                                                                                        # find a queue that fits the platoon
                                                                                                                        id_targetedge_sumo = traci.vehicle.getRoute(id_veh_entered_sumo)[-1]
                                                                                                                        print '    dispatch id_veh_entered_sumo %s with target %s' % (
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 1 day to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 549..581

                                                                                                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 216.

                                                                                                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

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

                                                                                                    def del_ghost(self, id_veh, id_ghost):
                                                                                                        print 'del_ghost id_veh %d id_ghost %d' % (id_veh, id_ghost)
                                                                                                        if id_ghost in self.ids_ghosts[id_veh]:
                                                                                                
                                                                                                            ind_ghost = list(self.ids_ghosts[id_veh]).index(id_ghost)
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 6 other locations - About 1 day to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 2124..2139
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 2184..2199
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2178..2193
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 2997..3012
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3041..3056
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 3094..3109

                                                                                                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 207.

                                                                                                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 7 locations. Consider refactoring.
                                                                                                Open

                                                                                                    def make_vtype(self):
                                                                                                        print 'make_vtype PRT'
                                                                                                        vtypes = self.get_scenario().demand.vtypes
                                                                                                        prttype = 'PRT'
                                                                                                        if not vtypes.ids_sumo.has_index(prttype):
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 6 other locations - About 1 day to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 2006..2039
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 2055..2088
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2049..2082
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 2860..2893
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 2904..2937
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 2957..2990

                                                                                                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 168.

                                                                                                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

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

                                                                                                    def init_trip_empty(self, id_veh, id_edge_sumo, stopline=None):
                                                                                                        print 'Vehicles.init_trip_empty', self.get_id_sumo(id_veh), id_edge_sumo, stopline
                                                                                                        self.states[id_veh] = VEHICLESTATES['emptytrip']
                                                                                                        id_veh_sumo = self.get_id_sumo(id_veh)
                                                                                                        if traci.vehicle.isStopped(id_veh_sumo):
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 4 other locations - About 1 day to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 2454..2474
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 2579..2599
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2573..2593
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3441..3461

                                                                                                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 163.

                                                                                                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 3 locations. Consider refactoring.
                                                                                                Open

                                                                                                    def get_ids_sumo_sorted(self, ids_sumo):
                                                                                                        """
                                                                                                        Returns an array with SUMO veh IDs in a way that first 
                                                                                                        vehicle has the highest position on the edge.
                                                                                                        """
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 2 other locations - About 1 day to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3271..3284
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3319..3333

                                                                                                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 146.

                                                                                                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

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

                                                                                                class VehicleAdder(Process):
                                                                                                    def __init__(self,  vehicles, logger=None, **kwargs):
                                                                                                        print 'VehicleAdder.__init__', vehicles, vehicles.parent.get_ident()
                                                                                                        self._init_common('vehicleadder', name='Vehicle adder',
                                                                                                                          logger=logger,
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 12 other locations - About 1 day to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-21-oldkd.py on lines 1204..1224
                                                                                                tools/contributed/sumopy/plugins/prt/prt-22-badkd.py on lines 1204..1224
                                                                                                tools/contributed/sumopy/plugins/prt/prt-23-newversionok.py on lines 1244..1264
                                                                                                tools/contributed/sumopy/plugins/prt/prt-24-mergemake.py on lines 1496..1516
                                                                                                tools/contributed/sumopy/plugins/prt/prt-25-oldmergenode.py on lines 1759..1779
                                                                                                tools/contributed/sumopy/plugins/prt/prt-26-stationproblem.py on lines 1895..1915
                                                                                                tools/contributed/sumopy/plugins/prt/prt-27-simplemergeok.py on lines 1856..1876
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 1905..1925
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 1954..1974
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 1948..1968
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 2759..2779
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 2803..2823

                                                                                                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 131.

                                                                                                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

                                                                                                                            if len(ids_platoon)*self.length_veh + 0.5 > length_plat:
                                                                                                                                print '    entire platoon length in queue, now relese...', ids_platoon
                                                                                                
                                                                                                                                # reschedule leader
                                                                                                                                vehicles.reschedule_trip(id_veh_arrived, id_targetedge_sumo)
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 1 day to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 674..690

                                                                                                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 127.

                                                                                                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

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

                                                                                                                        if not is_found_queue:
                                                                                                                            # print '      no queue with target or specific queue is full, search for a new queue'
                                                                                                
                                                                                                                            is_found_queue = False
                                                                                                                            for ind_queue, queue in zip(range(1, n_queues), queues[1:]):
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 7 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 304..331

                                                                                                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 118.

                                                                                                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

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

                                                                                                                        if len(inds_queue) > 0:
                                                                                                                            #ind_queue = ids_edge_sumo_target.index(id_targetedge_sumo)
                                                                                                                            ind_queue = inds_queue[0]
                                                                                                                            queue = queues[ind_queue]
                                                                                                                            capa_queue = capacities[ind_queue]
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 7 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 282..302
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 282..302
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 283..303

                                                                                                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 115.

                                                                                                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

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

                                                                                                    def _init_attributes(self):
                                                                                                        #self.add(cm.ObjConf(PrtBerths('berths',self))   )
                                                                                                
                                                                                                        self.add(cm.AttrConf('time_update', 1.0,
                                                                                                                             groupnames=['parameters'],
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 7 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 89..112
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 89..112
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 89..112

                                                                                                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 110.

                                                                                                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

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

                                                                                                    def _alloc_queue(self, queue, queue_alloc, capa_queue,
                                                                                                                     id_veh, id_veh_sumo,
                                                                                                                     id_shuntedge_sumo, vehicles):
                                                                                                
                                                                                                        queue.append(id_veh)
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 6 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 393..403

                                                                                                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 109.

                                                                                                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

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

                                                                                                    def reschedule_trip(self, id_veh, id_edge_sumo_to=None, route_sumo=None):
                                                                                                        print 'reschedule_trip', self.get_id_sumo(id_veh), id_edge_sumo_to, route_sumo
                                                                                                        id_veh_sumo = self.get_id_sumo(id_veh)
                                                                                                        if traci.vehicle.isStopped(id_veh_sumo):
                                                                                                            traci.vehicle.resume(id_veh_sumo)
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 4 other locations - About 6 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 2477..2491
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 2602..2616
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2596..2610
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3479..3493

                                                                                                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 106.

                                                                                                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

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

                                                                                                    def _alloc_queue(self, queue, queue_alloc, capa_queue,
                                                                                                                     id_veh, id_veh_sumo, id_targetedge_sumo,
                                                                                                                     id_shuntedge_sumo, vehicles):
                                                                                                        """Queue allocation for platoon leader only."""
                                                                                                        queue.append(id_veh)
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 6 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 697..711

                                                                                                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 104.

                                                                                                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

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

                                                                                                    def reschedule_trip_sumo(self, id_veh_sumo, id_edge_sumo_to=None, route_sumo=None):
                                                                                                        print 'reschedule_trip_sumo', id_veh_sumo, id_edge_sumo_to, route_sumo
                                                                                                        if traci.vehicle.isStopped(id_veh_sumo):
                                                                                                            traci.vehicle.resume(id_veh_sumo)
                                                                                                
                                                                                                
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 5 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3464..3477

                                                                                                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 89.

                                                                                                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 11 locations. Consider refactoring.
                                                                                                Open

                                                                                                        for id_comp,\
                                                                                                            id_detectedge_sumo,\
                                                                                                            ids_veh_detect_sumo,\
                                                                                                            ids_shuntedge,\
                                                                                                            ids_edge_sumo_target,\
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 10 other locations - About 5 hrs to fix
                                                                                                tools/contributed/sumopy/coremodules/network/networktools.py on lines 94..105
                                                                                                tools/contributed/sumopy/coremodules/network/networktools.py on lines 1569..1580
                                                                                                tools/contributed/sumopy/coremodules/network/networktools.py on lines 1656..1667
                                                                                                tools/contributed/sumopy/coremodules/network/networktools.py on lines 1751..1762
                                                                                                tools/contributed/sumopy/coremodules/network/networktools.py on lines 2181..2192
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 217..236
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 217..236
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 510..529
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 225..244
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 519..538

                                                                                                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 86.

                                                                                                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 5 locations. Consider refactoring.
                                                                                                Open

                                                                                                    def _update_concatenate(self, id_veh, length_plat):
                                                                                                        """
                                                                                                        Propagates length to the first vehicle of te platoon
                                                                                                        """
                                                                                                        # print '_update_concatenate prt.%s, length_plat=%.1f'%(id_veh,length_plat)
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 4 other locations - About 4 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 2382..2392
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2376..2386
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3259..3271
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 3312..3324

                                                                                                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 82.

                                                                                                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 3 locations. Consider refactoring.
                                                                                                Open

                                                                                                        for id_comp,\
                                                                                                            id_detectedge_sumo,\
                                                                                                            ids_veh_detect_sumo,\
                                                                                                            ids_shuntedge,\
                                                                                                            queues,\
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 2 other locations - About 4 hrs to fix
                                                                                                tools/contributed/sumopy/coremodules/network/networktools.py on lines 1905..1915
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 495..512

                                                                                                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 77.

                                                                                                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

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

                                                                                                    def stop_update(self, id_veh):
                                                                                                        if np.all(self.ids_ghosts[id_veh] == -1):  # id_veh has no ghosts?
                                                                                                            traci.vehicle.setSpeedMode(self.ids_sumo[id_veh], 31)
                                                                                                            if id_veh not in self.ids_ghosts:  # id_veh is no ghost ?
                                                                                                                self.are_update[id_veh] = False  # stop updating
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 6 other locations - About 4 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 2144..2148
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 2204..2208
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2198..2202
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3025..3029
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3069..3073
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 3122..3126

                                                                                                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 76.

                                                                                                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

                                                                                                                    if 0:
                                                                                                                        print '    QQQQQQ shunt %s ' % (id_shuntedge_sumo)
                                                                                                                        print '      simtime-releasetime_queue', simtime - \
                                                                                                                            releasetime_queue, (simtime - releasetime_queue > 15), (simtime -
                                                                                                                                                                                    self.releasetimes[id_comp] > 10)
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 3 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 619..625

                                                                                                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 70.

                                                                                                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

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

                                                                                                    def del_ghosts(self, id_veh, id_ghost):
                                                                                                        if self.ids_ghosts[id_veh][0] == -1:
                                                                                                            # id_veh has no ghosts
                                                                                                            return
                                                                                                        else:
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 6 other locations - About 3 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 2115..2122
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 2175..2182
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 2169..2176
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 2988..2995
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3032..3039
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 3085..3092

                                                                                                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 68.

                                                                                                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

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

                                                                                                    def reached_stop_sumo(self, id_veh_sumo):
                                                                                                        state = traci.vehicle.getStopState(id_veh_sumo)
                                                                                                        print 'reached_stop', id_veh_sumo, bin(state), bin(state)[-1] == '1'
                                                                                                        return bin(state)[-1] == '1'
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 3 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3370..3373
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3422..3425
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 3511..3514

                                                                                                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 65.

                                                                                                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

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

                                                                                                    def update(self, id_comp):
                                                                                                        print 'update id_comp', id_comp
                                                                                                        edges = self.get_scenario().net.edges
                                                                                                
                                                                                                        self.ids_detectoredge[id_comp] = edges.get_incoming(self.ids_shuntedges[id_comp][0])[0]
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 3 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 124..128
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 124..128
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 132..136

                                                                                                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 63.

                                                                                                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

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

                                                                                                    def make(self, id_detectoredge=None, **kwargs):
                                                                                                        print 'make', kwargs
                                                                                                        # print '  ids_shuntedge',kwargs.get('ids_shuntedge',None),type(kwargs.get('ids_shuntedge',None)[0])
                                                                                                        id_comp = self.add_row(ids_shuntedges=kwargs.get('ids_shuntedge', None),
                                                                                                                               ids_detectoredge=id_detectoredge
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 2 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 114..122
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 114..122
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 122..130

                                                                                                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

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

                                                                                                                        for i in range(len(queue_alloc)):
                                                                                                                            id_veh, id_targetedge_sumo = queue_alloc[i]
                                                                                                                            if vehicles.reached_stop_sumo(vehicles.ids_sumo[id_veh]):
                                                                                                                                id_veh_arrived = id_veh
                                                                                                                                ind_pl_alloc = i
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 2 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 635..640

                                                                                                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 57.

                                                                                                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

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

                                                                                                    def get_length(self):
                                                                                                        vtypes = self.ids_vtype.get_linktab()
                                                                                                
                                                                                                        # here take parameters from first vtype and assume that all are the same
                                                                                                        id_vtype = self.ids_vtype[self.get_ids()[0]]
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 2 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 2895..2901
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 2939..2945
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 2992..2998

                                                                                                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 51.

                                                                                                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

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

                                                                                                    def del_all_ghosts(self, id_veh):
                                                                                                        for id_ghost in self.ids_ghosts[id_veh]:
                                                                                                            if id_ghost > -1:
                                                                                                                self.del_ghost(id_veh, id_ghost)
                                                                                                
                                                                                                
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 2 hrs to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3017..3023
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3061..3067
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 3114..3120

                                                                                                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 50.

                                                                                                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

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

                                                                                                                        inds_queue = np.flatnonzero((np.array(ids_edge_sumo_target, object)
                                                                                                                                                     == id_targetedge_sumo) & np.array(are_queue_avail, dtype=np.bool))
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 1 hr to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 279..280
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 279..280
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 280..281

                                                                                                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 42.

                                                                                                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

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

                                                                                                    def get_platoonleader(self, id_veh):
                                                                                                        while self.ids_leader[id_veh] > -1:
                                                                                                            id_veh = self.ids_leader[id_veh]
                                                                                                        return id_veh
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 1 hr to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3266..3269
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3314..3317
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 3367..3370

                                                                                                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 41.

                                                                                                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 7 locations. Consider refactoring.
                                                                                                Open

                                                                                                                if 0:
                                                                                                                    print '  ids_veh_entered', ids_veh_entered, type(ids_veh_entered)
                                                                                                                    # print '  poss',poss
                                                                                                                    print '  ids_veh_entered_sumo', ids_veh_entered_sumo
                                                                                                                    print '  ids_leader', vehicles.ids_leader[ids_veh_entered]
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 6 other locations - About 1 hr to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-31-decompok.py on lines 257..262
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 257..262
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 534..539
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 257..262
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 551..556
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 560..565

                                                                                                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 41.

                                                                                                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 7 locations. Consider refactoring.
                                                                                                Open

                                                                                                                if 0:
                                                                                                                    print '  ids_veh_entered', ids_veh_entered, type(ids_veh_entered)
                                                                                                                    # print '  poss',poss
                                                                                                                    print '  ids_veh_entered_sumo', ids_veh_entered_sumo
                                                                                                                    print '  ids_leader', vehicles.ids_leader[ids_veh_entered]
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 6 other locations - About 1 hr to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-31-decompok.py on lines 531..536
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 257..262
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 534..539
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 257..262
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 551..556
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 560..565

                                                                                                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 41.

                                                                                                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

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

                                                                                                            if 0:
                                                                                                                print '  id_detectedge_sumo', id_detectedge_sumo
                                                                                                                print '  ids_veh_detect_sumo', ids_veh_detect_sumo, ids_veh_detect_sumo != ids_veh_sumo
                                                                                                                print '  ids_veh_sumo=', ids_veh_sumo
                                                                                                                ids_veh_sumo_raw = traci.edge.getLastStepVehicleIDs(id_detectedge_sumo)
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 6 other locations - About 1 hr to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-31-decompok.py on lines 244..249
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 244..249
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 521..526
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 244..249
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 538..543
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 547..552

                                                                                                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 40.

                                                                                                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

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

                                                                                                            if 0:
                                                                                                                print '  id_detectedge_sumo', id_detectedge_sumo
                                                                                                                print '  ids_veh_detect_sumo', ids_veh_detect_sumo, ids_veh_detect_sumo != ids_veh_sumo
                                                                                                                print '  ids_veh_sumo=', ids_veh_sumo
                                                                                                                ids_veh_sumo_raw = traci.edge.getLastStepVehicleIDs(id_detectedge_sumo)
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 6 other locations - About 1 hr to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-31-decompok.py on lines 518..523
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 244..249
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 521..526
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 244..249
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 538..543
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 547..552

                                                                                                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 40.

                                                                                                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

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

                                                                                                    def _alloc_queue_follower(self, queue, queue_alloc, capa_queue,
                                                                                                                              id_veh, id_veh_sumo,
                                                                                                                              id_shuntedge_sumo, vehicles):
                                                                                                        """Queue allocation for follower only."""
                                                                                                        queue.append(id_veh)
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 1 other location - About 1 hr to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 713..724

                                                                                                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 40.

                                                                                                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

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

                                                                                                    def set_stop(self, id_veh, id_edge_sumo, stopline, laneindex=1):
                                                                                                        # print 'set_stop',self.get_id_sumo(id_veh),stopline
                                                                                                        traci.vehicle.setStop(self.get_id_sumo(id_veh),
                                                                                                                              id_edge_sumo,
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 3 other locations - About 55 mins to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 3362..3365
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 3414..3417
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 3503..3506

                                                                                                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 37.

                                                                                                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

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

                                                                                                LEADVEHICLESTATES = [VEHICLESTATES['boarding'], VEHICLESTATES['waiting'],
                                                                                                                     VEHICLESTATES['emptytrip'], VEHICLESTATES['occupiedtrip']]
                                                                                                Severity: Major
                                                                                                Found in tools/contributed/sumopy/plugins/prt/prt-31-decompok.py and 21 other locations - About 40 mins to fix
                                                                                                tools/contributed/sumopy/plugins/prt/prt-13-newstartok.py on lines 50..51
                                                                                                tools/contributed/sumopy/plugins/prt/prt-14-progdelay.py on lines 50..51
                                                                                                tools/contributed/sumopy/plugins/prt/prt-15-ok.py on lines 50..51
                                                                                                tools/contributed/sumopy/plugins/prt/prt-16-ok-preplatoon.py on lines 50..51
                                                                                                tools/contributed/sumopy/plugins/prt/prt-17-prestoplanechange.py on lines 51..52
                                                                                                tools/contributed/sumopy/plugins/prt/prt-18-prewaittime.py on lines 51..52
                                                                                                tools/contributed/sumopy/plugins/prt/prt-19-premicromove.py on lines 51..52
                                                                                                tools/contributed/sumopy/plugins/prt/prt-20-brokealloc.py on lines 51..52
                                                                                                tools/contributed/sumopy/plugins/prt/prt-21-oldkd.py on lines 51..52
                                                                                                tools/contributed/sumopy/plugins/prt/prt-22-badkd.py on lines 51..52
                                                                                                tools/contributed/sumopy/plugins/prt/prt-23-newversionok.py on lines 53..54
                                                                                                tools/contributed/sumopy/plugins/prt/prt-24-mergemake.py on lines 53..54
                                                                                                tools/contributed/sumopy/plugins/prt/prt-25-oldmergenode.py on lines 53..54
                                                                                                tools/contributed/sumopy/plugins/prt/prt-26-stationproblem.py on lines 53..54
                                                                                                tools/contributed/sumopy/plugins/prt/prt-27-simplemergeok.py on lines 53..54
                                                                                                tools/contributed/sumopy/plugins/prt/prt-28.py on lines 53..54
                                                                                                tools/contributed/sumopy/plugins/prt/prt-29-plat-debug.py on lines 53..54
                                                                                                tools/contributed/sumopy/plugins/prt/prt-30-platok.py on lines 53..54
                                                                                                tools/contributed/sumopy/plugins/prt/prt-32-decomptargetprob.py on lines 53..54
                                                                                                tools/contributed/sumopy/plugins/prt/prt-33-prenewenter.py on lines 53..54
                                                                                                tools/contributed/sumopy/plugins/prt/prt.py on lines 53..54

                                                                                                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 34.

                                                                                                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

                                                                                                There are no issues that match your filters.

                                                                                                Category
                                                                                                Status