matteoferla/Fragmenstein

View on GitHub
fragmenstein/laboratory/_extras.py

Summary

Maintainability
C
7 hrs
Test Coverage

Function sw_search has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def sw_search(cls, combinations: pd.DataFrame, suffix: str,
Severity: Major
Found in fragmenstein/laboratory/_extras.py - About 1 hr to fix

    Function sw_search has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def sw_search(cls, combinations: pd.DataFrame, suffix: str,
                      sw_dist: int, sw_length: int,
                      sw_db: str,
                      top_mergers: int=1_000,
                      ranking: Optional[str] = None, ranking_ascending: Optional[bool] = None,
    Severity: Minor
    Found in fragmenstein/laboratory/_extras.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 _combine_ops has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _combine_ops(cls,
    Severity: Major
    Found in fragmenstein/laboratory/_extras.py - About 1 hr to fix

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

          def error_classify(cls, text):
              if not text:
                  return cls.error_classifications['SUCCESS']
              text = str(text)
              for key, value in cls.error_classifications.items():
      Severity: Minor
      Found in fragmenstein/laboratory/_extras.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 replace_hits has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def replace_hits(cls,
      Severity: Major
      Found in fragmenstein/laboratory/_extras.py - About 50 mins to fix

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

            def convert_to_sdf(self,
        Severity: Minor
        Found in fragmenstein/laboratory/_extras.py - About 45 mins to fix

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

              def _place_ops(cls, analogs, pdbblock, n_cores, timeout, suffix, **settings) -> pd.DataFrame:
          Severity: Minor
          Found in fragmenstein/laboratory/_extras.py - About 45 mins to fix

            There are no issues that match your filters.

            Category
            Status