StellarCN/py-stellar-base

View on GitHub

Showing 2,412 of 2,412 total issues

TODO found
Open

    # TODO: add support for FeeBumpTransactionEnvelope
Severity: Minor
Found in stellar_sdk/base_soroban_server.py by fixme

TODO found
Open

    # TODO: Protocol 20?

TODO found
Open

# TODO: You need to replace the following parameters according to the actual situation

TODO found
Open

# TODO: You need to replace the following parameters according to the actual situation

TODO found
Open

# TODO: You need to replace the following parameters according to the actual situation
Severity: Minor
Found in examples/soroban_deploy_contract.py by fixme

TODO found
Open

        except aiohttp.ClientError as e:  # TODO: need more research
Severity: Minor
Found in stellar_sdk/client/aiohttp_client.py by fixme

Method "__init__" has 9 parameters, which is greater than the 7 authorized.
Open

        self,
        horizon_url: str,
        client: BaseAsyncClient,
        base: Asset,
        counter: Asset,

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

Remove this commented out code.
Open

# tx.transaction.soroban_data.resources.instructions = stellar_xdr.Uint32(

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Remove this commented out code.
Open

# tx.transaction.soroban_data.resources.instructions = stellar_xdr.Uint32(

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed.
Open

def _decode_check(version_byte: _VersionByte, encoded: str) -> bytes:
Severity: Critical
Found in stellar_sdk/strkey.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Remove this commented out code.
Open

# with open(contract_file_path, "rb") as f:

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Method "__init__" has 9 parameters, which is greater than the 7 authorized.
Open

        self,
        horizon_url: str,
        client: BaseSyncClient,
        base: Asset,
        counter: Asset,

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...
Severity
Category
Status
Source
Language