Showing 558 of 559 total issues

File marker_base.py has 759 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from __future__ import annotations
import os
from abc import ABC, abstractmethod
from typing import (
    Dict,
Severity: Major
Found in rasa/core/evaluation/marker_base.py - About 1 day to fix

    File response_selector.py has 747 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    from __future__ import annotations
    import copy
    import logging
    from rasa.nlu.featurizers.featurizer import Featurizer
    
    
    Severity: Major
    Found in rasa/nlu/selectors/response_selector.py - About 1 day to fix

      File models.py has 738 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import time
      import random
      import tensorflow as tf
      import numpy as np
      import logging
      Severity: Major
      Found in rasa/utils/tensorflow/models.py - About 1 day to fix

        File yaml_story_reader.py has 714 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import copy
        import functools
        import json
        from json import JSONDecodeError
        import logging
        Severity: Major
        Found in rasa/shared/core/training_data/story_reader/yaml_story_reader.py - About 1 day to fix

          File generator.py has 664 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          from collections import defaultdict, namedtuple, deque
          
          import copy
          import logging
          import random
          Severity: Major
          Found in rasa/shared/core/generator.py - About 1 day to fix

            File structures.py has 650 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import json
            import logging
            from collections import deque, defaultdict
            
            import uuid
            Severity: Major
            Found in rasa/shared/core/training_data/structures.py - About 1 day to fix

              File count_vectors_featurizer.py has 636 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              from __future__ import annotations
              import logging
              import re
              import scipy.sparse
              from typing import Any, Dict, List, Optional, Text, Tuple, Set, Type
              Severity: Major
              Found in rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.py - About 1 day to fix

                File forms.py has 588 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import copy
                from typing import Text, List, Optional, Union, Any, Dict, Set
                import itertools
                import logging
                import structlog
                Severity: Major
                Found in rasa/core/actions/forms.py - About 1 day to fix

                  File lm_featurizer.py has 579 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  from __future__ import annotations
                  import numpy as np
                  import logging
                  
                  from typing import Any, Text, List, Dict, Tuple, Type
                  Severity: Major
                  Found in rasa/nlu/featurizers/dense_featurizer/lm_featurizer.py - About 1 day to fix

                    File training_data.py has 566 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import logging
                    import os
                    from pathlib import Path
                    import random
                    from collections import Counter, OrderedDict
                    Severity: Major
                    Found in rasa/shared/nlu/training_data/training_data.py - About 1 day to fix

                      Function _generate has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _generate(
                              self, story_steps: List[StoryStep], is_rule_data: bool = False
                          ) -> List[TrackerWithCachedStates]:
                              if not story_steps:
                                  logger.debug(f"No {'rules' if is_rule_data else 'story blocks'} found.")
                      Severity: Minor
                      Found in rasa/shared/core/generator.py - About 1 day 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

                      File policy.py has 553 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      from __future__ import annotations
                      import abc
                      import copy
                      import logging
                      from enum import Enum
                      Severity: Major
                      Found in rasa/core/policies/policy.py - About 1 day to fix

                        File crf_entity_extractor.py has 522 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        from __future__ import annotations
                        
                        from collections import OrderedDict
                        from enum import Enum
                        import logging
                        Severity: Major
                        Found in rasa/nlu/extractors/crf_entity_extractor.py - About 1 day to fix

                          File slack.py has 510 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import asyncio
                          import hashlib
                          import hmac
                          from http import HTTPStatus
                          import json
                          Severity: Major
                          Found in rasa/core/channels/slack.py - About 1 day to fix

                            File rasa_yaml.py has 497 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import logging
                            from collections import OrderedDict
                            from pathlib import Path
                            from typing import Text, Any, List, Dict, Tuple, Union, Iterator, Optional, Callable
                            
                            
                            Severity: Minor
                            Found in rasa/shared/nlu/training_data/formats/rasa_yaml.py - About 7 hrs to fix

                              File visualization.py has 492 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              from collections import defaultdict, deque
                              
                              import random
                              from typing import (
                                  Any,
                              Severity: Minor
                              Found in rasa/shared/core/training_data/visualization.py - About 7 hrs to fix

                                File transformer.py has 490 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                from typing import Optional, Text, Tuple, Union
                                
                                import numpy as np
                                import tensorflow as tf
                                
                                
                                Severity: Minor
                                Found in rasa/utils/tensorflow/transformer.py - About 7 hrs to fix

                                  File graph.py has 489 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  from __future__ import annotations
                                  
                                  import dataclasses
                                  from abc import ABC, abstractmethod
                                  from dataclasses import dataclass, field
                                  Severity: Minor
                                  Found in rasa/engine/graph.py - About 7 hrs to fix

                                    File io.py has 485 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    from collections import OrderedDict
                                    import errno
                                    import glob
                                    from hashlib import md5
                                    from io import StringIO
                                    Severity: Minor
                                    Found in rasa/shared/utils/io.py - About 7 hrs to fix

                                      File validation.py has 479 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      import inspect
                                      import logging
                                      import typing
                                      from typing import (
                                          Optional,
                                      Severity: Minor
                                      Found in rasa/engine/validation.py - About 7 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language