MarcoAndreaBuchmann/bme280pi

View on GitHub
bme280pi/readout.py

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

File readout.py has 330 lines of code (exceeds 250 allowed). Consider refactoring.
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,
Severity: Minor
Found in bme280pi/readout.py - About 3 hrs to fix

    Remove those useless parentheses.
    Invalid

        var1 = ((((temp_raw >> 3) - (dig_t[0] << 1))) * (dig_t[1])) >> 11
    Severity: Major
    Found in bme280pi/readout.py by sonar-python

    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
    

    There are no issues that match your filters.

    Category
    Status