rioxarray icon indicating copy to clipboard operation
rioxarray copied to clipboard

LNT: code complexity

Open snowman2 opened this issue 6 years ago • 3 comments

$ radon cc --min B rioxarray --total-average
rioxarray/rioxarray.py
    M 1080:4 RasterArray.to_raster - B
    M 697:4 RasterArray.reproject - B
    M 861:4 RasterArray.clip_box - B
    M 290:4 XRasterBase.write_crs - B
    M 529:4 RasterArray.nodata - B
    M 562:4 RasterArray.resolution - B
    M 603:4 RasterArray._check_dimensions - B
    M 1172:4 RasterDataset.crs - B
    M 223:4 XRasterBase.crs - B
    M 922:4 RasterArray.clip - B
rioxarray/_io.py
    F 197:0 open_rasterio - E
    M 60:4 RasterioArrayWrapper._get_indexer - B
    M 118:4 RasterioArrayWrapper._getitem - B
    F 176:0 _parse_tags - B

70 blocks (classes, functions, methods) analyzed.
Average complexity: A (3.5714285714285716)

http://radon.readthedocs.org/en/latest/index.html https://www.codacy.com/

snowman2 avatar Sep 27 '19 19:09 snowman2

  • http://pylint.pycqa.org/en/stable/technical_reference/extensions.html#design-checker-documentation
  • https://coverage.readthedocs.io/en/stable/config.html#report (coverage report --fail-under=95)

snowman2 avatar Aug 30 '21 17:08 snowman2

python -m pylint rioxarray
************* Module rioxarray.raster_array
rioxarray/raster_array.py:602:4: R1260: 'clip_box' is too complex. The McCabe rating is 11 (too-complex)
************* Module rioxarray.raster_writer
rioxarray/raster_writer.py:37:0: R1260: '_write_metatata_to_raster' is too complex. The McCabe rating is 13 (too-complex)
************* Module rioxarray._io
rioxarray/_io.py:707:0: R1260: 'open_rasterio' is too complex. The McCabe rating is 21 (too-complex)

-------------------------------------------------------------------
Your code has been rated at 9.98/10 (previous run: 10.00/10, -0.02)

snowman2 avatar Aug 30 '21 18:08 snowman2

https://github.com/rubik/xenon

snowman2 avatar Sep 01 '21 17:09 snowman2