StellarCN/py-stellar-base

View on GitHub

Showing 2,461 of 2,461 total issues

Line too long (114 > 79 characters)
Open

            typically you don't need to pass this parameter, it will be automatically called if you don't pass it.
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 (89 > 79 characters)
Open

        simulation. It is advisable to check the fee on returned transaction and validate
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 (117 > 79 characters)
Open

    See `CAP-0015 <https://github.com/stellar/stellar-protocol/blob/master/core/cap-0015.md>`__ for more information.
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.

Line too long (83 > 79 characters)
Open

    async def _post(self, request_body: Request, response_body_type: Type[V]) -> V:
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 (155 > 79 characters)
Open

                f"Invalid `base_fee`, it should be at least {self._inner_transaction.fee if self._inner_transaction.fee > BASE_FEE else BASE_FEE} stroops."
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.

Line too long (80 > 79 characters)
Open

        cls, xdr_object: stellar_xdr.FeeBumpTransaction, network_passphrase: str
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.

Line too long (85 > 79 characters)
Open

            type=stellar_xdr.EnvelopeType.ENVELOPE_TYPE_TX, v1=xdr_object.inner_tx.v1
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.

Line too long (87 > 79 characters)
Open

        base_fee = int(xdr_object.fee.int64 / (inner_transaction_operation_length + 1))
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

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

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

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: Protocol 20?

TODO found
Open

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

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"

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

def to_native(
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

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"

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):
    ...

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

Severity
Category
Status
Source
Language