OWASP / O-Saft

O-Saft - OWASP SSL advanced forensic tool
GNU General Public License v2.0
373 stars 86 forks source link

Use another variable assignment with a combined operator #129

Closed elfring closed 2 years ago

elfring commented 2 years ago

:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of combined operators accordingly.

diff --git a/checkAllCiphers.pl b/checkAllCiphers.pl
index 89704cc..82d2144 100755
--- a/checkAllCiphers.pl
+++ b/checkAllCiphers.pl
@@ -264,7 +264,7 @@ while ($#argv >= 0) {
     if ($arg =~ /^--trace([_-]?cmd)$/i)                 { $cfg{'traceCMD'}++;    next; } # ..
     if ($arg =~ /^--trace(@|[_-]?key)$/i)               { $cfg{'traceKEY'}++;    next; } # ..
     if ($arg =~ /^--trace=(\d+)$/i)                     { $cfg{'trace'}    = $1; next; }
-    if ($arg =~ /^--trace([_-]?time)$/i)                { $cfg{'traceTIME'}++;   $cfg{'trace'} = $cfg{'trace'}||1; next; } # Timestamp on; trace on if it was off
+    if ($arg =~ /^--trace([_-]?time)$/i)                { $cfg{'traceTIME'}++;   $cfg{'trace'} ||= 1; next; } # Timestamp on; trace on if it was off
     if ($arg =~ /^--?p(?:ort)?=(\d+)$/i)                { $cfg{'port'}     = $1; next; }
     if ($arg =~ /^--?h(?:ost)?=(.+)$/i)                 { push(@{$cfg{'hosts'}}, $1 . ":" . ($cfg{'port'}||443)); next; }     
     # proxy options
EnDe commented 2 years ago

fixed checkALLCiphers.pl 1.27

elfring commented 2 years ago

Thanks for your integration of another source code improvement.

EnDe commented 2 years ago

You're welcome. I always appreciate any improvement in code and text.

elfring commented 2 years ago

💭 Would you become interested to achieve similar code adjustments with more advanced transformation tools?

EnDe commented 2 years ago

Yes for sure. I'm not really happy with perlcritic, which is currently used. Just to note: must run locally.

elfring commented 2 years ago

💭 Do you get any further development ideas from similar transformation suggestions which I published for various software components?