lenskit/lkpy

View on GitHub

Showing 653 of 653 total issues

ItemList has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

class ItemList:
    """
    Representation of a (usually ordered) list of items, possibly with scores
    and other associated data; many components take and return item lists.  Item
    lists are to be treated as **immutable** — create a new list with modified
Severity: Minor
Found in lenskit/lenskit/data/items.py - About 3 hrs to fix

    Dataset has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Dataset(ABC):
        """
        Representation of a data set for LensKit training, evaluation, etc. Data can
        be accessed in a variety of formats depending on the needs of a component.
    
    
    Severity: Minor
    Found in lenskit/lenskit/data/dataset.py - About 2 hrs to fix

      Function fit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def fit(self, data: Dataset, **kwargs):
              """
              Train a FunkSVD model.
      
              Args:
      Severity: Minor
      Found in lenskit-funksvd/lenskit/funksvd.py - About 1 hr to fix

        Function fit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def fit(self, data: Dataset, **kwargs):
                """
                Train a model.
        
                The model-training process depends on ``save_nbrs`` and ``min_sim``, but *not* on other
        Severity: Minor
        Found in lenskit/lenskit/algorithms/knn/item.py - About 1 hr to fix

          Function predict_for_user has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def predict_for_user(self, user, items, ratings=None):
                  """
                  Compute predictions for a user and items.
          
                  Args:
          Severity: Minor
          Found in lenskit/lenskit/algorithms/knn/user.py - About 1 hr to fix

            Avoid too many return statements within this function.
            Open

                return False
            Severity: Major
            Found in lenskit/lenskit/pipeline/types.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return NotImplemented
              Severity: Major
              Found in lenskit/lenskit/parallel/serialize.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return True
                Severity: Major
                Found in lenskit/lenskit/pipeline/types.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return True
                  Severity: Major
                  Found in lenskit/lenskit/pipeline/types.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return reduce_storage(obj)
                    Severity: Major
                    Found in lenskit/lenskit/parallel/serialize.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return True
                      Severity: Major
                      Found in lenskit/lenskit/pipeline/types.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return True
                        Severity: Major
                        Found in lenskit/lenskit/pipeline/types.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return False
                          Severity: Major
                          Found in lenskit/lenskit/pipeline/types.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return cls(user_id=data)
                            Severity: Major
                            Found in lenskit/lenskit/data/query.py - About 30 mins to fix

                              Line too long (87 > 79 characters)
                              Open

                                          _logger.warn("implicit algorithm already trained, re-fit is usually a bug")
                              Severity: Minor
                              Found in lenskit-implicit/lenskit/implicit.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 (83 > 79 characters)
                              Open

                                          the ``(min, max)`` rating values to clamp ratings, or ``None`` to leave
                              Severity: Minor
                              Found in lenskit-funksvd/lenskit/funksvd.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

                                      _logger.debug("have %d estimates for %d ratings", len(initial), len(rate_df))
                              Severity: Minor
                              Found in lenskit-funksvd/lenskit/funksvd.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 (93 > 79 characters)
                              Open

                                  care what kind of data is in `data`, so long as it is a Pandas DataFrame (or equivalent).
                              Severity: Minor
                              Found in lenskit/lenskit/crossfold.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.

                              Whitespace before ':'
                              Open

                                      trains = test_sets[:i] + test_sets[(i + 1) :]
                              Severity: Minor
                              Found in lenskit/lenskit/crossfold.py by pep8

                              Avoid extraneous whitespace.

                              Avoid extraneous whitespace in these situations:
                              - Immediately inside parentheses, brackets or braces.
                              - Immediately before a comma, semicolon, or colon.
                              
                              Okay: spam(ham[1], {eggs: 2})
                              E201: spam( ham[1], {eggs: 2})
                              E201: spam(ham[ 1], {eggs: 2})
                              E201: spam(ham[1], { eggs: 2})
                              E202: spam(ham[1], {eggs: 2} )
                              E202: spam(ham[1 ], {eggs: 2})
                              E202: spam(ham[1], {eggs: 2 })
                              
                              E203: if x == 4: print x, y; x, y = y , x
                              E203: if x == 4: print x, y ; x, y = y, x
                              E203: if x == 4 : print x, y; x, y = y, x

                              Line too long (88 > 79 characters)
                              Open

                                          "wanted %d disjoint splits of %d each, but only have %d rows; partitioning",
                              Severity: Minor
                              Found in lenskit/lenskit/crossfold.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