prkumar/uplink

View on GitHub

Showing 9 of 34 total issues

File interfaces.py has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Local imports
from uplink import compat
 
 
class IllegalRequestStateTransition(RuntimeError):
Severity: Minor
Found in uplink/clients/io/interfaces.py - About 2 hrs to fix

    Function users_for_keyword has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def users_for_keyword():
    """
    /users?keyword=<keyword>[?oldest-age=<age in weeks>]
     
    Find the top users who have commited in repositories matching the keyword in the last month"""
    Severity: Minor
    Found in examples/github-api/Server.py - About 55 mins to fix

    Function get_call_args has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_call_args(f, *args, **kwargs):
    sig = signature(f)
    arguments = sig.bind(*args, **kwargs).arguments
    # apply defaults:
    new_arguments = []
    Severity: Minor
    Found in uplink/utils.py - About 55 mins to fix

    Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def __init__(
    Severity: Minor
    Found in uplink/builder.py - About 45 mins to fix

      Function _encode_pydantic_v1 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def _encode_pydantic_v1(obj: Any) -> Any:
      from pydantic.v1.json import pydantic_encoder
       
      # json atoms
      if isinstance(obj, str | int | float | bool) or obj is None:
      Severity: Minor
      Found in uplink/converters/pydantic_v1.py - About 45 mins to fix

      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def __init__(
      Severity: Minor
      Found in uplink/commands.py - About 35 mins to fix

        Function commits_for_repo has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def commits_for_repo(
        Severity: Minor
        Found in examples/github-api/Server.py - About 35 mins to fix

          Avoid too many return statements within this function.
          Open

          return None
          Severity: Major
          Found in uplink/converters/typing_.py - About 30 mins to fix

            Function _base_converter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            def _base_converter(self, type_):
            if isinstance(type_, BaseTypeConverter.Builder):
            return type_.build()
            if self._check_typing(type_):
            if issubclass(type_.__origin__, self.typing.Sequence):
            Severity: Minor
            Found in uplink/converters/typing_.py - About 25 mins to fix
            Severity
            Category
            Status
            Source
            Language