Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable debug route by default #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Disable debug route by default #45

wants to merge 1 commit into from

Conversation

arnaud-morvan
Copy link
Contributor

No description provided.

@arnaud-morvan
Copy link
Contributor Author

Lost really long time with CI to find what was going wrong in:

$ docker compose run --rm check
All done! ✨ 🍰 ✨
15 files would be left unchanged.
Success: no issues found in 15 source files
************* Module maelstro.main
main.py:83:0: C0301: Line too long (91/88) (line-too-long)
main.py:48:0: R0913: Too many arguments (6/5) (too-many-arguments)
main.py:48:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments)
main.py:109:0: C0116: Missing function or method docstring (missing-function-docstring)
main.py:116:0: C0116: Missing function or method docstring (missing-function-docstring)
main.py:121:0: C0116: Missing function or method docstring (missing-function-docstring)
main.py:126:0: C0116: Missing function or method docstring (missing-function-docstring)
main.py:135:0: C0116: Missing function or method docstring (missing-function-docstring)
main.py:144:0: C0116: Missing function or method docstring (missing-function-docstring)
main.py:147:4: C0103: Argument name "metadataUuid" doesn't conform to snake_case naming style (invalid-name)
main.py:144:0: R0913: Too many arguments (6/5) (too-many-arguments)
main.py:144:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments)
main.py:163:0: C0116: Missing function or method docstring (missing-function-docstring)
main.py:167:4: C0103: Argument name "metadataUuid" doesn't conform to snake_case naming style (invalid-name)
main.py:163:0: R0913: Too many arguments (8/5) (too-many-arguments)
main.py:163:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments)
main.py:196:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module maelstro.core.operations
core/operations.py:80:0: C0301: Line too long (91/88) (line-too-long)
core/operations.py:1:0: C0114: Missing module docstring (missing-module-docstring)
core/operations.py:9:0: C0414: Import alias does not rename original package (useless-import-alias)
core/operations.py:14:0: C0116: Missing function or method docstring (missing-function-docstring)
core/operations.py:59:0: C0116: Missing function or method docstring (missing-function-docstring)
core/operations.py:71:0: C0115: Missing class docstring (missing-class-docstring)
core/operations.py:86:4: C0116: Missing function or method docstring (missing-function-docstring)
core/operations.py:91:4: C0116: Missing function or method docstring (missing-function-docstring)
core/operations.py:100:4: C0116: Missing function or method docstring (missing-function-docstring)
core/operations.py:103:4: C0116: Missing function or method docstring (missing-function-docstring)
core/operations.py:10:0: C0412: Imports from package geonetwork are not grouped (ungrouped-imports)
************* Module maelstro.core
core/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
core/__init__.py:1:0: C0414: Import alias does not rename original package (useless-import-alias)
************* Module maelstro.core.exceptions
core/exceptions.py:1:0: C0114: Missing module docstring (missing-module-docstring)
core/exceptions.py:7:0: C0115: Missing class docstring (missing-class-docstring)
core/exceptions.py:16:4: C0116: Missing function or method docstring (missing-function-docstring)
core/exceptions.py:20:0: C0115: Missing class docstring (missing-class-docstring)
core/exceptions.py:25:0: C0115: Missing class docstring (missing-class-docstring)
core/exceptions.py:31:0: C0115: Missing class docstring (missing-class-docstring)
core/exceptions.py:37:0: C0115: Missing class docstring (missing-class-docstring)
core/exceptions.py:3:0: C0411: standard import "dataclasses.dataclass" should be placed before third party import "fastapi.HTTPException" (wrong-import-order)
************* Module maelstro.core.georchestra
core/georchestra.py:76:0: C0301: Line too long (96/88) (line-too-long)
core/georchestra.py:1:0: C0114: Missing module docstring (missing-module-docstring)
core/georchestra.py:16:0: C0115: Missing class docstring (missing-class-docstring)
core/georchestra.py:20:4: C0116: Missing function or method docstring (missing-function-docstring)
core/georchestra.py:28:4: C0116: Missing function or method docstring (missing-function-docstring)
core/georchestra.py:36:12: C0415: Import outside toplevel (geoservercloud.services.restclient) (import-outside-toplevel)
core/georchestra.py:59:4: C0116: Missing function or method docstring (missing-function-docstring)
core/georchestra.py:83:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module maelstro.core.clone
core/clone.py:292:0: C0301: Line too long (109/88) (line-too-long)
core/clone.py:307:0: C0301: Line too long (105/88) (line-too-long)
core/clone.py:1:0: C0114: Missing module docstring (missing-module-docstring)
core/clone.py:20:0: C0115: Missing class docstring (missing-class-docstring)
core/clone.py:20:0: R0902: Too many instance attributes (10/7) (too-many-instance-attributes)
core/clone.py:35:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:40:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:47:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:50:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:50:4: R0914: Too many local variables (22/15) (too-many-locals)
core/clone.py:131:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:186:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:186:4: R0912: Too many branches (13/12) (too-many-branches)
core/clone.py:233:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:245:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:251:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:269:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:280:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:298:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:313:4: C0116: Missing function or method docstring (missing-function-docstring)
core/clone.py:371:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module maelstro.metadata.meta
metadata/meta.py:1:0: C0114: Missing module docstring (missing-module-docstring)
metadata/meta.py:29:0: C0115: Missing class docstring (missing-class-docstring)
metadata/meta.py:37:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:38:19: I1101: Module 'lxml.etree' has no 'parse' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
metadata/meta.py:47:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:48:19: I1101: Module 'lxml.etree' has no 'parse' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
metadata/meta.py:57:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:71:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:82:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:83:19: I1101: Module 'lxml.etree' has no 'parse' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
metadata/meta.py:101:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:101:38: I1101: Module 'lxml.etree' has no '_Element' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
metadata/meta.py:107:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:107:51: I1101: Module 'lxml.etree' has no '_Element' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
metadata/meta.py:115:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:115:39: I1101: Module 'lxml.etree' has no '_Element' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
metadata/meta.py:118:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:118:40: I1101: Module 'lxml.etree' has no '_Element' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
metadata/meta.py:121:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:121:40: I1101: Module 'lxml.etree' has no '_Element' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
metadata/meta.py:124:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:124:44: I1101: Module 'lxml.etree' has no '_Element' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
metadata/meta.py:127:4: C0116: Missing function or method docstring (missing-function-docstring)
metadata/meta.py:127:44: I1101: Module 'lxml.etree' has no '_Element' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
metadata/meta.py:136:0: C0115: Missing class docstring (missing-class-docstring)
metadata/meta.py:176:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module maelstro.metadata
metadata/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module maelstro.config
config/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
config/__init__.py:1:0: C0414: Import alias does not rename original package (useless-import-alias)
config/__init__.py:2:0: C0414: Import alias does not rename original package (useless-import-alias)
************* Module maelstro.config.config
config/config.py:1:0: C0114: Missing module docstring (missing-module-docstring)
config/config.py:8:0: C0115: Missing class docstring (missing-class-docstring)
config/config.py:22:0: C0115: Missing class docstring (missing-class-docstring)
config/config.py:37:4: C0116: Missing function or method docstring (missing-function-docstring)
config/config.py:57:4: C0116: Missing function or method docstring (missing-function-docstring)
config/config.py:63:4: C0116: Missing function or method docstring (missing-function-docstring)
config/config.py:66:4: C0116: Missing function or method docstring (missing-function-docstring)
config/config.py:76:4: C0116: Missing function or method docstring (missing-function-docstring)
config/config.py:79:4: C0116: Missing function or method docstring (missing-function-docstring)
config/config.py:82:4: C0116: Missing function or method docstring (missing-function-docstring)
config/config.py:138:0: C0116: Missing function or method docstring (missing-function-docstring)
config/config.py:178:0: C0116: Missing function or method docstring (missing-function-docstring)
config/config.py:4:0: C0411: standard import "typing.Any" should be placed before third party import "yaml" (wrong-import-order)


Report
======
610 statements analysed.

Statistics by type
------------------

+---------+-------+-----------+-----------+------------+---------+
|type     |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module   |11     |NC         |NC         |18.18       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|class    |12     |NC         |NC         |0.00        |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|method   |55     |NC         |NC         |23.64       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|function |23     |NC         |NC         |43.48       |0.00     |
+---------+-------+-----------+-----------+------------+---------+



External dependencies
---------------------
::

    fastapi (maelstro.core.exceptions,maelstro.core.operations,maelstro.main)
      \-exception_handlers (maelstro.core.operations)
      \-responses (maelstro.main)
    fastapi_cli 
      \-utils 
        \-cli (maelstro)
    geonetwork (maelstro.core.clone,maelstro.core.georchestra)
      \-exceptions (maelstro.core.operations)
      \-gn_logger (maelstro.core.operations)
    geoservercloud 
      \-services (maelstro.core.clone,maelstro.core.georchestra)
        \-restclient (maelstro.core.georchestra)
        \-restlogger (maelstro.core.operations)
    lxml 
      \-etree (maelstro.metadata.meta)
    maelstro 
      \-common 
      | \-types (maelstro.config.config,maelstro.core.clone,maelstro.metadata.meta)
      \-config (maelstro.core.clone,maelstro.core.georchestra)
      \-logging 
      | \-psql_logger (maelstro.core.operations)
      \-metadata (maelstro.core.clone)
    requests (maelstro.core.operations)
      \-exceptions (maelstro.core.georchestra,maelstro.core.operations)
    uvicorn (maelstro)
    yaml (maelstro.config.config)



1321 lines have been analyzed

Raw metrics
-----------

+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |990    |74.94 |NC       |NC         |
+----------+-------+------+---------+-----------+
|docstring |124    |9.39  |NC       |NC         |
+----------+-------+------+---------+-----------+
|comment   |22     |1.67  |NC       |NC         |
+----------+-------+------+---------+-----------+
|empty     |185    |14.00 |NC       |NC         |
+----------+-------+------+---------+-----------+



Duplication
-----------

+-------------------------+------+---------+-----------+
|                         |now   |previous |difference |
+=========================+======+=========+===========+
|nb duplicated lines      |0     |NC       |NC         |
+-------------------------+------+---------+-----------+
|percent duplicated lines |0.000 |NC       |NC         |
+-------------------------+------+---------+-----------+



Messages by category
--------------------

+-----------+-------+---------+-----------+
|type       |number |previous |difference |
+===========+=======+=========+===========+
|convention |91     |NC       |NC         |
+-----------+-------+---------+-----------+
|refactor   |9      |NC       |NC         |
+-----------+-------+---------+-----------+
|warning    |0      |NC       |NC         |
+-----------+-------+---------+-----------+
|error      |0      |NC       |NC         |
+-----------+-------+---------+-----------+



% errors / warnings by module
-----------------------------

+---------------------------+------+--------+---------+-----------+
|module                     |error |warning |refactor |convention |
+===========================+======+========+=========+===========+
|maelstro.main              |0.00  |0.00    |66.67    |12.09      |
+---------------------------+------+--------+---------+-----------+
|maelstro.core.clone        |0.00  |0.00    |33.33    |19.78      |
+---------------------------+------+--------+---------+-----------+
|maelstro.metadata.meta     |0.00  |0.00    |0.00     |17.58      |
+---------------------------+------+--------+---------+-----------+
|maelstro.config.config     |0.00  |0.00    |0.00     |14.29      |
+---------------------------+------+--------+---------+-----------+
|maelstro.core.operations   |0.00  |0.00    |0.00     |12.09      |
+---------------------------+------+--------+---------+-----------+
|maelstro.core.georchestra  |0.00  |0.00    |0.00     |8.79       |
+---------------------------+------+--------+---------+-----------+
|maelstro.core.exceptions   |0.00  |0.00    |0.00     |8.79       |
+---------------------------+------+--------+---------+-----------+
|maelstro.config.__init__   |0.00  |0.00    |0.00     |3.30       |
+---------------------------+------+--------+---------+-----------+
|maelstro.core.__init__     |0.00  |0.00    |0.00     |2.20       |
+---------------------------+------+--------+---------+-----------+
|maelstro.metadata.__init__ |0.00  |0.00    |0.00     |1.10       |
+---------------------------+------+--------+---------+-----------+



Messages
--------

+------------------------------+------------+
|message id                    |occurrences |
+==============================+============+
|missing-function-docstring    |55          |
+------------------------------+------------+
|missing-class-docstring       |12          |
+------------------------------+------------+
|c-extension-no-member         |10          |
+------------------------------+------------+
|missing-module-docstring      |9           |
+------------------------------+------------+
|line-too-long                 |5           |
+------------------------------+------------+
|useless-import-alias          |4           |
+------------------------------+------------+
|too-many-positional-arguments |3           |
+------------------------------+------------+
|too-many-arguments            |3           |
+------------------------------+------------+
|wrong-import-order            |2           |
+------------------------------+------------+
|invalid-name                  |2           |
+------------------------------+------------+
|ungrouped-imports             |1           |
+------------------------------+------------+
|too-many-locals               |1           |
+------------------------------+------------+
|too-many-instance-attributes  |1           |
+------------------------------+------------+
|too-many-branches             |1           |
+------------------------------+------------+
|import-outside-toplevel       |1           |
+------------------------------+------------+




-----------------------------------
Your code has been rated at 8.36/10

maybe we should consider configuring pylint instead of :

! (( $? & 7 ))  # mask exit code for minor findings (refactor, convention, usage)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants