aLkRicha/insta_browser

View on GitHub

Showing 7 of 9 total issues

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

    def process(self, exclude, login):
        """
        liking pre-processed posts. Moving to each post with ActionChains

        :param exclude:
Severity: Minor
Found in insta_browser/processors/feed_processor.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 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, debug=False, chrome=False, cookie_path=None, log_path=None, db_path=None,
Severity: Major
Found in insta_browser/browser.py - About 50 mins to fix

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

        def go_through_posts(self, count):
            self.count = count
            time.sleep(.5)
            self.post_already_liked = 0
            progress = tqdm.tqdm(range(self.count))
    Severity: Minor
    Found in insta_browser/processors/not_feed_processor.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 auth_with_credentials has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def auth_with_credentials(browser, logger, login, password, cookie_path=tempfile.gettempdir()):
    Severity: Minor
    Found in insta_browser/auth.py - About 35 mins to fix

      Function __do_i_need_to_follow_this_user has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def __do_i_need_to_follow_this_user(self) -> bool:
              """
              Check if i need to follow current user
              :return: bool
              """
      Severity: Minor
      Found in insta_browser/processors/base_processor.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

      Function __is_last_post_in_feed_not_liked has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def __is_last_post_in_feed_not_liked(self):
              """
              Check last five posts if they are not liked
      
              :return: False if one of five posts wasn't liked, True if all five were liked
      Severity: Minor
      Found in insta_browser/processors/feed_processor.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

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

          def follow_user(self) -> bool:
              """
              Follow user if need and could
              :return: bool
              """
      Severity: Minor
      Found in insta_browser/processors/base_processor.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