LGTM.com - false positive [py/redundant-comparison]
- Vorherrschende Sprache
- CodeQL
- Sterne
- 10.1k
- Forks
- 2.1k
- Ø Merge
- 2 T. 15 Std.
- Gemergte PRs (30 T.)
- 141
Beschreibung
**Description of the false positive**
```python
class RandomMirrorPoints(object):
def __init__(self, parameters):
pass
def __call__(self, ptcloud, rnd_value):
trfm_mat = transforms3d.zooms.zfdir2mat(1)
trfm_mat_x = np.dot(transforms3d.zooms.zfdir2mat(-1, [1, 0, 0]), trfm_mat)
trfm_mat_z = np.dot(transforms3d.zooms.zfdir2mat(-1, [0, 0, 1]), trfm_mat)
if rnd_value <= 0.25:
trfm_mat = np.dot(trfm_mat_x, trfm_mat)
trfm_mat = np.dot(trfm_mat_z, trfm_mat)
elif rnd_value > 0.25 and rnd_value <= 0.5:
trfm_mat = np.dot(trfm_mat_x, trfm_mat)
elif rnd_value > 0.5 and rnd_value <= 0.75:
trfm_mat = np.dot(trfm_mat_z, trfm_mat)
ptcloud[:, :3] = np.dot(ptcloud[:, :3], trfm_mat.T)
return ptcloud
```
LGTM says that "elif rnd_value > 0.25" always returns true. However, it is not correct.
**URL to the alert on the project page on LGTM.com**
https://lgtm.com/projects/g/hzxie/GRNet/snapshot/3abd51ddee77f826698bc8284c79da3bc6ae4fa9/files/utils/data_transforms.py#xc400321fa866d530:1
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.