gunthercox/ChatterBot

View on GitHub

Showing 296 of 296 total issues

Avoid too many return statements within this function.
Open

            return relative_date - timedelta(days=1)
Severity: Major
Found in chatterbot/parsing.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return relative_date + timedelta(weeks=ord)
    Severity: Major
    Found in chatterbot/parsing.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return datetime(
      Severity: Major
      Found in chatterbot/parsing.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return relative_date - timedelta(days=relative_date.weekday())
        Severity: Major
        Found in chatterbot/parsing.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return day_of_week + timedelta(days=6 - relative_date.weekday())
          Severity: Major
          Found in chatterbot/parsing.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return datetime(year, month, day)
            Severity: Major
            Found in chatterbot/parsing.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return datetime(relative_date.year, relative_date.month - 1, relative_date.day)
              Severity: Major
              Found in chatterbot/parsing.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return relative_date + timedelta(days=ord)
                Severity: Major
                Found in chatterbot/parsing.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return datetime(relative_date.year, relative_date.month, relative_date.day, 23, 59, 59)
                  Severity: Major
                  Found in chatterbot/parsing.py - About 30 mins to fix

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

                        def learn_response(self, statement, previous_statement=None):
                            """
                            Learn that the statement provided is a valid response.
                            """
                            if not previous_statement:
                    Severity: Minor
                    Found in chatterbot/chatterbot.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

                    Line too long (93 > 79 characters)
                    Open

                                    for match in self.statements.find(kwargs).skip(start_index).limit(page_size):
                    Severity: Minor
                    Found in chatterbot/storage/mongodb.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 (86 > 79 characters)
                    Open

                        def process(self, input_statement, additional_response_selection_parameters=None):
                    Severity: Minor
                    Found in chatterbot/logic/best_match.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 (101 > 79 characters)
                    Open

                                data['search_in_response_to'] = self.tagger.get_text_index_string(data['in_response_to'])
                    Severity: Minor
                    Found in chatterbot/storage/mongodb.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 (162 > 79 characters)
                    Open

                                default = 'The database currently contains no entries. At least one entry is expected. You may need to train your chat bot to populate your database.'
                    Severity: Minor
                    Found in chatterbot/storage/storage_adapter.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 (89 > 79 characters)
                    Open

                            An exception to be raised when a storage adapter method has not been implemented.
                    Severity: Minor
                    Found in chatterbot/storage/storage_adapter.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 (90 > 79 characters)
                    Open

                            :param str tagger_language: The language that the tagger uses to remove stopwords.
                    Severity: Minor
                    Found in chatterbot/storage/storage_adapter.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 (84 > 79 characters)
                    Open

                            # Use the input statement as the closest match if no other results are found
                    Severity: Minor
                    Found in chatterbot/logic/best_match.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 (102 > 79 characters)
                    Open

                            self.chatbot.logger.info('Using "{}" as a close match to "{}" with a confidence of {}'.format(
                    Severity: Minor
                    Found in chatterbot/logic/best_match.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

                                kwargs['search_text'] = self.tagger.get_text_index_string(kwargs['text'])
                    Severity: Minor
                    Found in chatterbot/storage/sql_storage.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 (106 > 79 characters)
                    Open

                                    record.search_in_response_to = self.tagger.get_text_index_string(statement.in_response_to)
                    Severity: Minor
                    Found in chatterbot/storage/sql_storage.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.
                    Severity
                    Category
                    Status
                    Source
                    Language