StellarCN/py-stellar-base

View on GitHub

Showing 2,517 of 2,517 total issues

Line too long (109 > 79 characters)
Open

        :return: A :class:`SendTransactionResponse <stellar_sdk.soroban_rpc.SendTransactionResponse>` object.
Severity: Minor
Found in stellar_sdk/soroban_server_async.py by pep8

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Line too long (101 > 79 characters)
Open

        :return: A :class:`GetFeeStatsResponse <stellar_sdk.soroban_rpc.GetFeeStatsResponse>` object.
Severity: Minor
Found in stellar_sdk/soroban_server_async.py by pep8

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Line too long (100 > 79 characters)
Open

            entries from the simulation. In other words, if you include auth entries, you don't care
Severity: Minor
Found in stellar_sdk/soroban_server_async.py by pep8

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Line too long (81 > 79 characters)
Open

        :param xdr_object: The XDR object that represents a fee bump transaction.
Severity: Minor
Found in stellar_sdk/fee_bump_transaction.py by pep8

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

TODO found
Open

    # TODO: Protocol 20?

TODO found
Open

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

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

# 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

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

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

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

def to_native(sc_val: Union[stellar_xdr.SCVal, bytes, str]) -> Union[
Severity: Critical
Found in stellar_sdk/scval.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

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

# 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