Inspecting 1 file
iperf:19:86: C: Style/IfUnlessModifier: Modifier form of if makes the line too long. puts 'tcp.sender.bps: ' + obj['end']['streams'][0]['sender']['bits_per_second'].to_s if obj['end']['streams'][0]['sender'] ^^
iperf:20:90: C: Style/IfUnlessModifier: Modifier form of if makes the line too long. puts 'tcp.receiver.bps: ' + obj['end']['streams'][0]['receiver']['bits_per_second'].to_s if obj['end']['streams'][0]['receiver' ^^
Signed-off-by: Zhang Yu 2134782174@qq.com --- stats/iperf | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/stats/iperf b/stats/iperf index b5c6c403..f2521db6 100755 --- a/stats/iperf +++ b/stats/iperf @@ -16,6 +16,12 @@ end
exit if obj['end'].empty?
-puts 'tcp.sender.bps: ' + obj['end']['streams'][0]['sender']['bits_per_second'].to_s if obj['end']['streams'][0]['sender'] -puts 'tcp.receiver.bps: ' + obj['end']['streams'][0]['receiver']['bits_per_second'].to_s if obj['end']['streams'][0]['receiver'] -puts 'udp.bps: ' + obj['end']['streams'][0]['udp']['bits_per_second'].to_s if obj['end']['streams'][0]['udp'] +if obj['end']['streams'][0]['sender'] + puts 'tcp.sender.bps: ' + obj['end']['streams'][0]['sender']['bits_per_second'].to_s +end +if obj['end']['streams'][0]['receiver'] + puts 'tcp.receiver.bps: ' + obj['end']['streams'][0]['receiver']['bits_per_second'].to_s +end +if obj['end']['streams'][0]['udp'] + puts 'udp.bps: ' + obj['end']['streams'][0]['udp']['bits_per_second'].to_s +end