Mulugruntz/celery-pubsub

View on GitHub
.github/workflows/resolve_versions.py

Summary

Maintainability
A
0 mins
Test Coverage

Function process_matrix has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Wontfix

def process_matrix(args: Namespace) -> None:
    python_codes = json.loads(args.python_codes)
    operating_systems = json.loads(args.operating_systems)
    package_name = args.package_name
    specifiers = json.loads(args.specifiers)
Severity: Minor
Found in .github/workflows/resolve_versions.py - About 2 hrs 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 get_versions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Wontfix

def get_versions(
    package_name: str,
    platform: Optional[str],
    python_version: Optional[str],
    implementation: Optional[str],
Severity: Minor
Found in .github/workflows/resolve_versions.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

Consider using sys.exit()
Open

        exit(1)

Instead of using exit() or quit(), consider using the sys.exit().

Too few public methods (1/2)
Open

class OutputCapture(list[str]):

Used when class has too few public methods, so be sure it's really worth it.

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

def get_versions(

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)

Consider using sys.exit()
Open

    exit(1)

Instead of using exit() or quit(), consider using the sys.exit().

Value 'list' is unsubscriptable
Open

) -> list[str]:
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Emitted when a subscripted value doesn't support subscription (i.e. doesn't define getitem method or class_getitem for a class).

Value 'list' is unsubscriptable
Open

) -> list[str]:
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Emitted when a subscripted value doesn't support subscription (i.e. doesn't define getitem method or class_getitem for a class).

Value 'list' is unsubscriptable
Open

def filter_versions(versions: list[str], version_specifier: str) -> list[str]:
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Emitted when a subscripted value doesn't support subscription (i.e. doesn't define getitem method or class_getitem for a class).

Unable to import 'pip._internal.commands.index'
Open

import pip._internal.commands.index
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Used when pylint has been unable to import a module.

Value 'tuple' is unsubscriptable
Open

def get_python_version_and_implementation(python_code: str) -> tuple[str, str]:
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Emitted when a subscripted value doesn't support subscription (i.e. doesn't define getitem method or class_getitem for a class).

No name 'index' in module 'pip._internal.commands'
Open

import pip._internal.commands.index
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Used when a name cannot be found in a module.

Access to a protected member _internal of a client class
Open

    pip._internal.commands.index.write_output = output.write_output

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.

Unused variable 'impl'
Open

        impl, py_ver, *pypy_ver = python_code.split("-")

Used when a variable is defined but not used.

Module 'pip._internal.commands' has no 'index' member
Open

    pip._internal.commands.index.write_output = output.write_output
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Used when a variable is accessed for an unexistent member.

Value 'list' is unsubscriptable
Open

def filter_versions(versions: list[str], version_specifier: str) -> list[str]:
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Emitted when a subscripted value doesn't support subscription (i.e. doesn't define getitem method or class_getitem for a class).

No name 'index' in module 'pip._internal.commands'
Open

from pip._internal.commands.index import IndexCommand
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Used when a name cannot be found in a module.

Value 'list' is unsubscriptable
Open

class OutputCapture(list[str]):
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Emitted when a subscripted value doesn't support subscription (i.e. doesn't define getitem method or class_getitem for a class).

Unused argument 'args'
Open

    def write_output(self, msg: Any, *args: Any) -> None:

Used when a function or method argument is not used.

Unable to import 'pip._internal.commands.index'
Open

from pip._internal.commands.index import IndexCommand
Severity: Critical
Found in .github/workflows/resolve_versions.py by pylint

Used when pylint has been unable to import a module.

Unused variable 'pypy_ver'
Open

        impl, py_ver, *pypy_ver = python_code.split("-")

Used when a variable is defined but not used.

Line too long (81 > 79 characters)
Open

    parser_versions.add_argument("-s", "--specifier", type=str, help="Specifier")
Severity: Minor
Found in .github/workflows/resolve_versions.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 (82 > 79 characters)
Open

        args.python_code, args.operating_system, args.package_name, args.specifier
Severity: Minor
Found in .github/workflows/resolve_versions.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 (88 > 79 characters)
Open

                # This is because inspect.getfullargspec has been removed in Python 3.11
Severity: Minor
Found in .github/workflows/resolve_versions.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 (103 > 79 characters)
Open

        f"Found the following {args.package_name} versions: {', '.join(v for v in filtered_versions)}",
Severity: Minor
Found in .github/workflows/resolve_versions.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 (88 > 79 characters)
Open

    index = IndexCommand("index", "Inspect information available from package indexes.")
Severity: Minor
Found in .github/workflows/resolve_versions.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

    parser_versions.add_argument("-n", "--package-name", type=str, help="Package name")
Severity: Minor
Found in .github/workflows/resolve_versions.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

    parser_matrix.add_argument("-c", "--python-codes", type=str, help="Python codes")
Severity: Minor
Found in .github/workflows/resolve_versions.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

    parser_matrix.add_argument("-n", "--package-name", type=str, help="Package name")
Severity: Minor
Found in .github/workflows/resolve_versions.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.

Whitespace before ':'
Open

            return line[len(VERSION_START_TOKEN) :].split(", ")
Severity: Minor
Found in .github/workflows/resolve_versions.py by pep8

Avoid extraneous whitespace.

Avoid extraneous whitespace in these situations:
- Immediately inside parentheses, brackets or braces.
- Immediately before a comma, semicolon, or colon.

Okay: spam(ham[1], {eggs: 2})
E201: spam( ham[1], {eggs: 2})
E201: spam(ham[ 1], {eggs: 2})
E201: spam(ham[1], { eggs: 2})
E202: spam(ham[1], {eggs: 2} )
E202: spam(ham[1 ], {eggs: 2})
E202: spam(ham[1], {eggs: 2 })

E203: if x == 4: print x, y; x, y = y , x
E203: if x == 4: print x, y ; x, y = y, x
E203: if x == 4 : print x, y; x, y = y, x

Line too long (81 > 79 characters)
Open

    parser_matrix.add_argument("-s", "--specifiers", type=str, help="Specifiers")
Severity: Minor
Found in .github/workflows/resolve_versions.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

    implementation, python_version = get_python_version_and_implementation(python_code)
Severity: Minor
Found in .github/workflows/resolve_versions.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

    parser_versions.add_argument("-c", "--python-code", type=str, help="Python code")
Severity: Minor
Found in .github/workflows/resolve_versions.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

                # and `vine.five` 4.x was depending on it. This is fixed in 5.x.
Severity: Minor
Found in .github/workflows/resolve_versions.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.

Wrong hanging indentation before block (add 4 spaces).
Open

    package_name: str,

TODO package_name: str, ^ |

Missing function or method docstring
Open

    def write_output(self, msg: Any, *args: Any) -> None:

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def filter_versions(versions: list[str], version_specifier: str) -> list[str]:

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def process_matrix(args: Namespace) -> None:

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Variable name c doesn't conform to snake_case naming style
Open

    for c, o, n, s in matrix:

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

Missing function or method docstring
Open

def contains_version(version: str, version_specifier: str) -> bool:

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Wrong hanging indentation before block (add 4 spaces).
Open

                n == "celery"

TODO n == celery ^ |

Variable name s doesn't conform to snake_case naming style
Open

    for c, o, n, s in matrix:

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

Missing function or method docstring
Open

def main() -> None:

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Line too long (103/100)
Open

        f"Found the following {args.package_name} versions: {', '.join(v for v in filtered_versions)}",

Used when a line is longer than a given number of characters.

Missing module docstring
Open

import argparse

Used when a module has no docstring.Empty modules do not require a docstring.

Variable name n doesn't conform to snake_case naming style
Open

    for c, o, n, s in matrix:

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

Wrong hanging indentation before block (add 4 spaces).
Open

    implementation: Optional[str],

TODO implementation: Optional[str], ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

                # This is because inspect.getfullargspec has been removed in Python 3.11

TODO # This is because inspect.getfullargspec has been removed in Python 3.11 ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

    platform: Optional[str],

TODO platform: Optional[str], ^ |

Missing function or method docstring
Open

def get_versions(

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def process_versions(args: Namespace) -> None:

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Variable name o doesn't conform to snake_case naming style
Open

    for c, o, n, s in matrix:

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

Wrong hanging indentation before block (add 4 spaces).
Open

                and (

TODO and ( ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

    python_code: str, operating_system: str, package_name: str, specifier: str

TODO pythoncode: str, operatingsystem: str, package_name: str, specifier: str ^ |

Missing class docstring
Open

class OutputCapture(list[str]):

Used when a class has no docstring.Even an empty class must have a docstring.

Missing function or method docstring
Open

def get_python_version_and_implementation(python_code: str) -> tuple[str, str]:

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def parse_args() -> Namespace:

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def get_compatible_versions(

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Wrong hanging indentation before block (add 4 spaces).
Open

                and all(cv.startswith("4") for cv in compatible_versions)

TODO and all(cv.startswith(4) for cv in compatible_versions) ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

    python_version: Optional[str],

TODO python_version: Optional[str], ^ |

There are no issues that match your filters.

Category
Status