gmagklaras / POFR

Penguin OS Forensic (or Flight) Recorder
GNU General Public License v2.0
37 stars 5 forks source link

Convert three variable assignments to the usage of combined operators #1

Open elfring opened 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/client/sendproc.pl b/client/sendproc.pl
index 6cccd18..4e7354a 100755
--- a/client/sendproc.pl
+++ b/client/sendproc.pl
@@ -132,7 +132,7 @@ if ($firstssh->error == 0 && $nodealhits < 3 ) {
    sendfiles($server,$username,$password); 
 } elsif ( $firstssh->error != 0 && $nodealhits < 3) {
    print "sendproc.pl: Warning: Oops, missed a leftover tarball ssh connection!Will try again in $postponetime microseconds!";
-   $nodealhits=$nodealhits+1;
+   $nodealhits += 1;
    print "sendproc.pl: Info: nodealhits is: $nodealhits \n";
    usleep($postponetime);
    sendfiles($server,$username,$password);
@@ -256,7 +256,7 @@ sub sendfiles {

        } elsif ( $ssh->error != 0 && $nodealhits < 3 ) {
            print "sendproc.pl Warning: Oops, missed a connection while trying to upload a normal tarball file !Will try again in $postponetime microsecs! \n";
-               $nodealhits=$nodealhits+1;
+               $nodealhits += 1;
                print "sendproc.pl Info: nodealhits is: $nodealhits \n";
                usleep($postponetime);
            $ssh->scp_put({quiet=>0}, "/dev/shm/$secs$pmicrosecs#$tz#$digest.tar", "/home/$username/");
diff --git a/server/newdeltaparseproc.pl b/server/newdeltaparseproc.pl
index 0aa8175..3495e65 100755
--- a/server/newdeltaparseproc.pl
+++ b/server/newdeltaparseproc.pl
@@ -1868,7 +1868,7 @@ sub parsefiles {
        unlink "$threadspecificpath/dev/shm/$fitopr" or warn "parseproc.pl Warning: Could not unlink net file /home/$threadspecificpath/dev/shm/$fitopr: $!";

        #Increase the net file counter 
-       $netfcounter=$netfcounter+1;
+       $netfcounter += 1;

        if ($netfcounter == $threaddirremvindex ) { 
        #The very last thing we do inside the per thread  context is to cleanup the thread specific directories
gmagklaras commented 2 years ago

Thanks for submitting this, we will enter refactoring cycles of the code before we hit the first release of POFR, as we are currently heavily into feature enabling development mode. We will take into account your request.