pylint/checkers/similar.py
def _display_sims(self, sims):
        """display computed similarities on stdout"""
        nb_lignes_dupliquees = 0
        for num, couples in sims:
            print()
            print(num, "similar lines in", len(couples), "files")
            couples = sorted(couples)
            for lineset, idx in couples:
                print("==%s:%s" % (lineset.name, idx))
            # pylint: disable=W0631
            for line in lineset._real_lines[idx : idx + num]:
                print("  ", line.rstrip())
            nb_lignes_dupliquees += num * (len(couples) - 1)
        nb_total_lignes = sum([len(lineset) for lineset in self.linesets])
        print(
            "TOTAL lines=%s duplicates=%s percent=%.2f"
            % (
                nb_total_lignes,
                nb_lignes_dupliquees,
                nb_lignes_dupliquees * 100.0 / nb_total_lignes,
            )
        )
def _display_sims(self, sims):
        nb_lignes_dupliquees = 0
        for num, couples in sims:
            print()
            print(num, "similar lines in", len(couples), "files")
            couples = sorted(couples)
            for lineset, idx in couples:
                print("==%s:%s" % (lineset.name, idx))
            # pylint: disable=W0631
            for line in lineset._real_lines[idx : idx + num]:
                print("  ", line.rstrip())
            nb_lignes_dupliquees += num * (len(couples) - 1)
        nb_total_lignes = sum([len(lineset) for lineset in self.linesets])
        print(
            "TOTAL lines=%s duplicates=%s percent=%.2f"
            % (
                nb_total_lignes,
                nb_lignes_dupliquees,
                nb_lignes_dupliquees * 100.0 / nb_total_lignes,
            )
        )
def _display_sims ( self , sims ) : nb_lignes_dupliquees = 0 for num , couples in sims : print ( ) print ( num , "similar lines in" , len ( couples ) , "files" ) couples = sorted ( couples ) for lineset , idx in couples : print ( "==%s:%s" % ( lineset . name , idx ) ) # pylint: disable=W0631 for line in lineset . _real_lines [ idx : idx + num ] : print ( "  " , line . rstrip ( ) ) nb_lignes_dupliquees += num * ( len ( couples ) - 1 ) nb_total_lignes = sum ( [ len ( lineset ) for lineset in self . linesets ] ) print ( "TOTAL lines=%s duplicates=%s percent=%.2f" % ( nb_total_lignes , nb_lignes_dupliquees , nb_lignes_dupliquees * 100.0 / nb_total_lignes , ) )
display computed similarities on stdout
display computed similarities on stdout