mobolic/facebook-sdk

View on GitHub

Showing 9 of 11 total issues

File __init__.py has 404 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
#
# Copyright 2010 Facebook
# Copyright 2015 Mobolic
#
Severity: Minor
Found in facebook/__init__.py - About 5 hrs to fix

    Function request has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        def request(
            self, path, args=None, post_args=None, files=None, method=None
        ):
            """Fetches the given path in the Graph API.
    
    
    Severity: Minor
    Found in facebook/__init__.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 __init__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(
            self,
            access_token=None,
            timeout=None,
            version=None,
    Severity: Minor
    Found in facebook/__init__.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 __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, result):
            self.result = result
            self.code = None
            self.error_subcode = None
    
    
    Severity: Minor
    Found in facebook/__init__.py - About 55 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

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

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

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

      def get_current_user():
          """Set g.user to the currently logged in user.
      
          Called before each request, get_current_user sets the global g.user
          variable to the currently logged in user.  A currently logged in user is
      Severity: Minor
      Found in examples/flask/app/views.py - About 45 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

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

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

        Avoid too many return statements within this function.
        Open

            return data
        Severity: Major
        Found in facebook/__init__.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return False
          Severity: Major
          Found in facebook/__init__.py - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language