RFD-FHEM / RFFHEM

Counterpart of SIGNALDuino, it's the code for FHEM to work with the data received from the uC
GNU General Public License v3.0
44 stars 33 forks source link

PERL WARNING - sub ConvLaCrosse robust #1038

Closed HomeAutoUser closed 2 years ago

HomeAutoUser commented 2 years ago
codecov[bot] commented 2 years ago

Codecov Report

Merging #1038 (e3a8cca) into master (6959426) will increase coverage by 0.10%. The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1038      +/-   ##
==========================================
+ Coverage   60.68%   60.78%   +0.10%     
==========================================
  Files         117      117              
  Lines        9004     8984      -20     
  Branches     1411     1409       -2     
==========================================
- Hits         5464     5461       -3     
+ Misses       2533     2518      -15     
+ Partials     1007     1005       -2     
Flag Coverage Δ
fhem 51.54% <50.00%> (+0.10%) :arrow_up:
modules 60.78% <80.00%> (+0.10%) :arrow_up:
perl 91.61% <80.00%> (-0.05%) :arrow_down:
unittests 60.78% <80.00%> (+0.10%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
FHEM/lib/SD_Protocols.pm 79.17% <50.00%> (-0.10%) :arrow_down:
t/SD_Protocols/02_ConvLaCrosse.t 100.00% <100.00%> (ø)
t/FHEM/14_SD_BELL/09_parseDatat.t
t/FHEM/14_SD_AS/00_load.t 100.00% <0.00%> (ø)
FHEM/00_SIGNALduino.pm 63.81% <0.00%> (+0.64%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6959426...e3a8cca. Read the comment docs.

elektron-bbs commented 2 years ago

Wollen wir denn jetzt wirklich alles doppelt und dreifach prüfen? Diese Prüfung ist doch schon in der 00_SIGNALduino.pm sub SIGNALduino_Parse_MN enthalten:

  if ($rmsg !~ /^MN;D=[0-9A-F]+;(?:R=[0-9]+;)?$/){
    $hash->{logMethod}->($hash->{NAME}, 3, qq[$hash->{NAME}: Parse_MN, faulty msg: $rmsg]);
    return ; # Abort here if not successfull
  }
HomeAutoUser commented 2 years ago

Es geht mir in diesem PR nicht ums doppelt prüfen, es geht mir um die Robustheit der Sub als einzelnes. Der Gedanke war mal, das man Subs, einzeln nutzen kann um ggf Code zu sparen. Ja es kommt sehr selten vor. (fast unwarscheinlich in Devicespezifischen)

Nur wenn man jede Sub separat absichert, so kann man diverse PERL WARNINGs vermeiden. Es macht in meinen Augen keinen Sinn, Subs aufzurufen und zu testen indem man künstlich Warnings generiert. Entweder richtig oder die Liste und Logs werden länger und länger mit WARNINGs.

HomeAutoUser commented 2 years ago

@sidey79 bittefein :-)