bme280pi/readout.py
File readout.py
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Invalid
Invalid
"""Functions to read out and interpret the raw sensor data.
This module contains all functions necessary for reading out the raw data from
the BME280 sensor according to the Bosch data sheet, and processing this raw
data in order to obtain a more digestible format, i.e. the temperature,
Remove those useless parentheses. Invalid
Invalid
var1 = ((((temp_raw >> 3) - (dig_t[0] << 1))) * (dig_t[1])) >> 11
- Read upRead up
- Exclude checks
The use of parentheses, even those not required to enforce a desired order of operations, can clarify the intent behind a piece of code. But redundant pairs of parentheses could be misleading, and should be removed.
Noncompliant Code Example
return ((3)) # Noncompliant return ((x + 1)) # Noncompliant x = ((y / 2)) + 1 # Noncompliant
Compliant Solution
return 3 return (3) return x + 1 return (x + 1) x = y / 2 + 1 x = (y / 2) + 1