Showing 23 of 37 total issues

Avoid too many return statements within this function.
Open

                    return True
Severity: Major
Found in node_tools/sched_funcs.py - About 30 mins to fix

    Function get_net_cmds has a Cognitive Complexity of 19 (exceeds 18 allowed). Consider refactoring.
    Open

    def get_net_cmds(bin_dir, iface=None, state=False):
        import os
    
        res = None
        if not os.path.isdir(bin_dir):
    Severity: Minor
    Found in node_tools/network_funcs.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

    Function echo_client has a Cognitive Complexity of 19 (exceeds 18 allowed). Consider refactoring.
    Open

    def echo_client(fpn_id, addr, send_cfg=False):
        import json
        from node_tools import state_data as st
        from node_tools.msg_queues import make_version_msg
        from node_tools.node_funcs import do_shutdown
    Severity: Minor
    Found in node_tools/network_funcs.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

    Severity
    Category
    Status
    Source
    Language