Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ameraner committed Jun 21, 2023
1 parent 7941c22 commit 7432312
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions satpy/readers/seviri_l1b_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,13 @@ def _read_header(self):

if '15_MAIN_PRODUCT_HEADER' not in self.header:
logger.info("Quality flag check was not possible due to missing 15_MAIN_PRODUCT_HEADER.")
else:
if self.header['15_MAIN_PRODUCT_HEADER']['QQOV']['Value'] == 'NOK':
warnings.warn(
"The quality flag for this file indicates not OK. "
"Use this data with caution!",
UserWarning,
stacklevel=2
)
elif self.header['15_MAIN_PRODUCT_HEADER']['QQOV']['Value'] == 'NOK':

Check warning on line 375 in satpy/readers/seviri_l1b_native.py

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

NativeMSGFileHandler._read_header increases in cyclomatic complexity from 11 to 12, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
warnings.warn(
"The quality flag for this file indicates not OK. "
"Use this data with caution!",
UserWarning,
stacklevel=2
)

def _read_trailer(self):

Expand Down

0 comments on commit 7432312

Please sign in to comment.