class documentation

Checks for similarities and duplicated code. This computation may be memory / CPU intensive, so you should disable it if you experience some problems.

Method __init__ Checker instances should have the linter as argument.
Method close Compute and display similarities on closing (i.e. end of parsing).
Method get_map_data Passthru override.
Method open Init the checkers: reset linesets and statistics information.
Method process_module Process a module.
Method reduce_map_data Reduces and recombines data into a format that we can report on.
Class Variable name Name of the provider.
Class Variable options Options provided by this provider.
Class Variable reports Undocumented
Instance Variable linesets Undocumented

Inherited from BaseChecker (via BaseRawFileChecker):

Method __eq__ Permit to assert Checkers are equal.
Method __gt__ Sorting of checkers.
Method __hash__ Make Checker hashable.
Method __repr__ Undocumented
Method __str__ This might be incomplete because multiple classes inheriting BaseChecker can have the same name.
Method add_message Undocumented
Method check_consistency Check the consistency of msgid.
Method create_message_definition_from_tuple Undocumented
Method get_full_documentation Undocumented
Method get_message_definition Undocumented
Class Variable enabled Undocumented
Class Variable msgs Undocumented
Instance Variable linter Undocumented
Property messages Undocumented

Inherited from _ArgumentsProvider (via BaseRawFileChecker, BaseChecker):

Method get_option_def DEPRECATED: Return the dictionary defining an option given its name.
Method level.setter Undocumented
Method load_defaults DEPRECATED: Initialize the provider using default values.
Method option_attrname DEPRECATED: Get the config attribute corresponding to opt.
Method option_value DEPRECATED: Get the current value for the given option.
Method options_and_values DEPRECATED.
Method options_by_section DEPRECATED: Return an iterator on options grouped by section.
Method set_option DEPRECATED: Method called to set an option (registered in the options list).
Class Variable option_groups_descs Option groups of this provider and their descriptions.
Property config Undocumented
Property level Undocumented
Instance Variable _arguments_manager The manager that will parse and register any options provided.
Instance Variable _level Undocumented

Inherited from Similar (via BaseRawFileChecker, BaseChecker, _ArgumentsProvider):

Method append_stream Append a file to search for similarities.
Method combine_mapreduce_data Reduces and recombines data into a format that we can report on.
Method run Start looking for similarities and display results on stdout.
Instance Variable namespace Undocumented
Method _compute_sims Compute similarities in appended files.
Method _display_sims Display computed similarities on stdout.
Method _find_common Find similarities in the two given linesets.
Method _get_similarity_report Create a report from similarities.
Method _iter_sims Iterate on similarities among all files, by making a Cartesian product.
def __init__(self, linter: PyLinter): (source)

Checker instances should have the linter as argument.

def close(self): (source)

Compute and display similarities on closing (i.e. end of parsing).

def get_map_data(self) -> list[LineSet]: (source)

Passthru override.

def open(self): (source)

Init the checkers: reset linesets and statistics information.

def process_module(self, node: nodes.Module): (source)

Process a module. the module's content is accessible via the stream object stream must implement the readlines method

def reduce_map_data(self, linter: PyLinter, data: list[list[LineSet]]): (source)

Reduces and recombines data into a format that we can report on. The partner function of get_map_data()

Name of the provider.

Options provided by this provider.