| Total Complexity | 0 |
| Total Lines | 17 |
| Duplicated Lines | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | """Test AggregateStatsRequest message.""" |
||
| 10 | View Code Duplication | class TestAggregateStatsRequest(TestMsgDumpFile): |
|
|
|
|||
| 11 | """Test class for TestAggregateStatsRequest.""" |
||
| 12 | |||
| 13 | dumpfile = 'v0x01/ofpt_aggregate_request.dat' |
||
| 14 | |||
| 15 | match = Match(in_port=80, dl_src="01:02:03:04:05:06", |
||
| 16 | dl_dst="01:02:03:04:05:06", dl_vlan=1, |
||
| 17 | dl_vlan_pcp=1, dl_type=1, |
||
| 18 | nw_tos=1, nw_proto=1, |
||
| 19 | nw_src='192.168.0.1', nw_dst='192.168.0.1', |
||
| 20 | tp_src=80, tp_dst=80) |
||
| 21 | request = AggregateStatsRequest(table_id=1, out_port=Port.OFPP_NONE, |
||
| 22 | match=match) |
||
| 23 | obj = StatsRequest(xid=17, |
||
| 24 | body_type=StatsTypes.OFPST_AGGREGATE, |
||
| 25 | flags=0, body=request) |
||
| 26 | min_size = 12 |
||
| 27 |