felipevolpone/ray

View on GitHub

Showing 6 of 11 total issues

Function process_action has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def process_action(self):
        action_class = None

        method = None
        try:
Severity: Minor
Found in ray-core/ray/actions.py - About 1 hr 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 action has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def action(url, protection=None, authentication=False, method=None):
    # url e.g: /<id>/action_name

    def dec(func):
        if protection:
Severity: Minor
Found in ray-core/ray/actions.py - About 1 hr 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 login has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def login(cls, login_data):
        user_json = cls.authenticate(login_data)

        if not hasattr(cls, 'salt_key'):
            raise NotImplementedError('You must define the salt_key method')
Severity: Minor
Found in ray-core/ray/authentication.py - About 35 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

Avoid too many return statements within this function.
Open

        return EndpointHandler(request, fullpath).process()
Severity: Major
Found in ray-core/ray/api.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return __handle_action(fullpath), 200
    Severity: Major
    Found in ray-core/ray/api.py - About 30 mins to fix

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

      def process(fullpath, request, response):
      
          if __is_login(fullpath):
              return LoginHandler.process(request, response)
      
      
      Severity: Minor
      Found in ray-core/ray/api.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

      Severity
      Category
      Status
      Source
      Language