chrislit/abydos

View on GitHub
abydos/distance/_generalized_fleiss.py

Summary

Maintainability
A
3 hrs
Test Coverage

File _generalized_fleiss.py has 258 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Severity: Minor
Found in abydos/distance/_generalized_fleiss.py - About 2 hrs to fix

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

        def __init__(
    Severity: Major
    Found in abydos/distance/_generalized_fleiss.py - About 50 mins to fix

      Method "__init__" has 8 parameters, which is greater than the 7 authorized.
      Open

              self,
              alphabet: Optional[
                  Union[TCounter[str], Sequence[str], Set[str], int]
              ] = None,
              tokenizer: Optional[_Tokenizer] = None,

      A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

      Noncompliant Code Example

      With a maximum number of 4 parameters:

      def do_something(param1, param2, param3, param4, param5):
          ...
      

      Compliant Solution

      def do_something(param1, param2, param3, param4):
          ...
      

      Too many arguments (7/5)
      Open

          def __init__(

      Used when a function or method takes too many arguments.

      Wrong hanging indentation before block (add 4 spaces).
      Open

              self,

      TODO self, ^ |

      Wrong hanging indentation before block (add 4 spaces).
      Open

              marginals: str = 'a',

      TODO marginals: str = 'a', ^ |

      Variable name b doesn't conform to snake_case naming style
      Open

                  b /= n

      Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

      Variable name d doesn't conform to snake_case naming style
      Open

              d = self._total_complement_card()

      Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

      Wrong hanging indentation before block (add 4 spaces).
      Open

              alphabet: Optional[

      TODO alphabet: Optional[ ^ |

      Variable name n doesn't conform to snake_case naming style
      Open

              n = self._population_unique_card()

      Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

      Wrong hanging indentation before block (add 4 spaces).
      Open

              proportional: bool = False,

      TODO proportional: bool = False, ^ |

      Wrong hanging indentation before block (add 4 spaces).
      Open

              mean_func: str = 'arithmetic',

      TODO mean_func: str = 'arithmetic', ^ |

      Variable name c doesn't conform to snake_case naming style
      Open

              c = self._tar_only_card()

      Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

      Variable name c doesn't conform to snake_case naming style
      Open

                  c /= n

      Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

      Wrong hanging indentation before block (add 4 spaces).
      Open

              intersection_type: str = 'crisp',

      TODO intersection_type: str = 'crisp', ^ |

      Variable name a doesn't conform to snake_case naming style
      Open

                  a /= n

      Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

      Wrong hanging indentation before block (add 4 spaces).
      Open

              tokenizer: Optional[_Tokenizer] = None,

      TODO tokenizer: Optional[_Tokenizer] = None, ^ |

      Variable name d doesn't conform to snake_case naming style
      Open

                  d /= n

      Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

      Variable name a doesn't conform to snake_case naming style
      Open

              a = self._intersection_card()

      Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

      Wrong hanging indentation before block (add 4 spaces).
      Open

              **kwargs: Any

      TODO **kwargs: Any ^ |

      Constant name means doesn't conform to UPPER_CASE naming style
      Open

      means = {

      Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

      Variable name b doesn't conform to snake_case naming style
      Open

              b = self._src_only_card()

      Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

      There are no issues that match your filters.

      Category
      Status