Dronehub/fastapi-satella-metrics

View on GitHub

Showing 8 of 8 total issues

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Minor
Found in fastapi_satella_metrics/__init__.py - About 35 mins to fix

    Function PrometheusExporter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def PrometheusExporter(
        extra_labels: tp.Optional[dict] = None, url: str = "/metrics"
    ) -> APIRouter:
        """
        Return a router that exports metrics
    Severity: Minor
    Found in fastapi_satella_metrics/prometheus_exporter.py - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Fenced code blocks should be surrounded by blank lines
    Open

    ```python
    Severity: Info
    Found in README.md by markdownlint

    MD031 - Fenced code blocks should be surrounded by blank lines

    Tags: code, blank_lines

    Aliases: blanks-around-fences

    This rule is triggered when fenced code blocks are either not preceded or not followed by a blank line:

    Some text
    ```
    Code block
    ```
    
    ```
    Another code block
    ```
    Some more text

    To fix this, ensure that all fenced code blocks have a blank line both before and after (except where the block is at the beginning or end of the document):

    Some text
    
    ```
    Code block
    ```
    
    ```
    Another code block
    ```
    
    Some more text

    Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse fenced code blocks that don't have blank lines before and after them.

    Fenced code blocks should be surrounded by blank lines
    Open

    ```
    Severity: Info
    Found in README.md by markdownlint

    MD031 - Fenced code blocks should be surrounded by blank lines

    Tags: code, blank_lines

    Aliases: blanks-around-fences

    This rule is triggered when fenced code blocks are either not preceded or not followed by a blank line:

    Some text
    ```
    Code block
    ```
    
    ```
    Another code block
    ```
    Some more text

    To fix this, ensure that all fenced code blocks have a blank line both before and after (except where the block is at the beginning or end of the document):

    Some text
    
    ```
    Code block
    ```
    
    ```
    Another code block
    ```
    
    Some more text

    Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse fenced code blocks that don't have blank lines before and after them.

    Fenced code blocks should be surrounded by blank lines
    Open

    ```python
    Severity: Info
    Found in README.md by markdownlint

    MD031 - Fenced code blocks should be surrounded by blank lines

    Tags: code, blank_lines

    Aliases: blanks-around-fences

    This rule is triggered when fenced code blocks are either not preceded or not followed by a blank line:

    Some text
    ```
    Code block
    ```
    
    ```
    Another code block
    ```
    Some more text

    To fix this, ensure that all fenced code blocks have a blank line both before and after (except where the block is at the beginning or end of the document):

    Some text
    
    ```
    Code block
    ```
    
    ```
    Another code block
    ```
    
    Some more text

    Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse fenced code blocks that don't have blank lines before and after them.

    Fenced code blocks should be surrounded by blank lines
    Open

    ```python
    Severity: Info
    Found in README.md by markdownlint

    MD031 - Fenced code blocks should be surrounded by blank lines

    Tags: code, blank_lines

    Aliases: blanks-around-fences

    This rule is triggered when fenced code blocks are either not preceded or not followed by a blank line:

    Some text
    ```
    Code block
    ```
    
    ```
    Another code block
    ```
    Some more text

    To fix this, ensure that all fenced code blocks have a blank line both before and after (except where the block is at the beginning or end of the document):

    Some text
    
    ```
    Code block
    ```
    
    ```
    Another code block
    ```
    
    Some more text

    Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse fenced code blocks that don't have blank lines before and after them.

    Fenced code blocks should be surrounded by blank lines
    Open

    ```
    Severity: Info
    Found in README.md by markdownlint

    MD031 - Fenced code blocks should be surrounded by blank lines

    Tags: code, blank_lines

    Aliases: blanks-around-fences

    This rule is triggered when fenced code blocks are either not preceded or not followed by a blank line:

    Some text
    ```
    Code block
    ```
    
    ```
    Another code block
    ```
    Some more text

    To fix this, ensure that all fenced code blocks have a blank line both before and after (except where the block is at the beginning or end of the document):

    Some text
    
    ```
    Code block
    ```
    
    ```
    Another code block
    ```
    
    Some more text

    Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse fenced code blocks that don't have blank lines before and after them.

    Headers should be surrounded by blank lines
    Open

    fastapi-satella-metrics
    Severity: Info
    Found in README.md by markdownlint

    MD022 - Headers should be surrounded by blank lines

    Tags: headers, blank_lines

    Aliases: blanks-around-headers

    This rule is triggered when headers (any style) are either not preceded or not followed by a blank line:

    # Header 1
    Some text
    
    Some more text
    ## Header 2

    To fix this, ensure that all headers have a blank line both before and after (except where the header is at the beginning or end of the document):

    # Header 1
    
    Some text
    
    Some more text
    
    ## Header 2

    Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse headers that don't have a blank line before, and will parse them as regular text.

    Severity
    Category
    Status
    Source
    Language