piotrmaslanka/satella

View on GitHub
satella/coding/concurrent/futures/futures.py

Summary

Maintainability
A
0 mins
Test Coverage
B
83%

Either all return statements in a function should return an expression, or none of them should.
Open

        def inner(fut: PythonFuture):

According to PEP8, if any return statement returns an expression, any return statements where no value is returned should explicitly state this as return None, and an explicit return statement should be present at the end of the function (if reachable)

Unnecessary else after return
Open

    if not isinstance(fut, Future):

Used in order to highlight an unnecessary block of code following an if containing a return statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a return statement.

Unnecessary else after return
Open

        if self.source_future._state == FINISHED:

Used in order to highlight an unnecessary block of code following an if containing a return statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a return statement.

Unnecessary else after return
Open

        if self._state == PRE_FINISHED:

Used in order to highlight an unnecessary block of code following an if containing a return statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a return statement.

Unnecessary else after return
Open

        if self._state == PRE_FINISHED:

Used in order to highlight an unnecessary block of code following an if containing a return statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a return statement.

Either all return statements in a function should return an expression, or none of them should.
Open

        def inner(fut: PythonFuture):

According to PEP8, if any return statement returns an expression, any return statements where no value is returned should explicitly state this as return None, and an explicit return statement should be present at the end of the function (if reachable)

Access to a protected member _state of a client class
Open

            return self.source_future._state

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _exception of a client class
Open

            return fun(fut._exception)

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _state of a client class
Open

        if self.source_future._state == FINISHED:

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _base of a client class
Open

concurrent.futures._base._STATE_TO_DESCRIPTION_MAP[PRE_FINISHED] = 'pre-finished'

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _result of a client class
Open

            return fun(fut._result)

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _base of a client class
Open

    class InvalidStateError(concurrent.futures._base.Error):

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Catching too general exception Exception
Open

            except Exception:

Used when an except catches a too general exception, possibly burying unrelated errors.

Access to a protected member _exception of a client class
Open

        if future._exception is not None:

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _exception of a client class
Open

            if future._exception is not None:

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _exception of a client class
Open

                result = future._exception

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _result of a client class
Open

            self.set_result(future._result)

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _exception of a client class
Open

            if fut._exception is not None:

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Catching too general exception Exception
Open

        except Exception:

Used when an except catches a too general exception, possibly burying unrelated errors.

Access to a protected member _FUTURE_STATES of a client class
Open

concurrent.futures._base._FUTURE_STATES.append(PRE_FINISHED)

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Signature differs from overridden 'exception' method
Open

    def exception(self, timeout: None) -> tp.Type[Exception]:

Used when a method signature is different than in the implemented interface or in an overridden method.

Access to a protected member _exception of a client class
Open

            self.set_exception(future._exception)

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _STATE_TO_DESCRIPTION_MAP of a client class
Open

concurrent.futures._base._STATE_TO_DESCRIPTION_MAP[PRE_FINISHED] = 'pre-finished'

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _exception of a client class
Open

            if fut._exception is None:

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _result of a client class
Open

                result = future._result

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Access to a protected member _base of a client class
Open

concurrent.futures._base._FUTURE_STATES.append(PRE_FINISHED)

Used when a protected member (i.e. class member with a name beginning with an underscore) is access outside the class or a descendant of the class where it's defined.

Line too long (81 > 79 characters)
Open

                    raise InvalidStateError('{}: {!r}'.format(self._state, self))

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

                if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:

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

                if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:

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

        """Raised when the future is in invalid state to execute given operation"""

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

                    raise InvalidStateError('{}: {!r}'.format(self._state, self))

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

concurrent.futures._base._STATE_TO_DESCRIPTION_MAP[PRE_FINISHED] = 'pre-finished'

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

            if self._state not in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]:

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 (94 > 79 characters)
Open

        Schedule function to be called with the result of this future as it's argument only if

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

from concurrent.futures._base import CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED

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

    A future that allows it's callback handlers to change it's result before presenting

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

        Schedule function to be called with the exception value that befall this future

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 (90 > 79 characters)
Open

        Schedule function to be called with the result of this future as it's argument (or

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.

Argument name v doesn't conform to snake_case naming style
Open

    def _state(self, v: str):

Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

Argument name fn doesn't conform to snake_case naming style
Open

    def add_pre_done_callback(self, fn):

Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

There are no issues that match your filters.

Category
Status