fname
stringlengths
63
176
rel_fname
stringclasses
706 values
line
int64
-1
4.5k
name
stringlengths
1
81
kind
stringclasses
2 values
category
stringclasses
2 values
info
stringlengths
0
77.9k
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,854
qname
ref
function
return node.qname() in self._never_returning_functions
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,858
_check_return_at_the_end
def
function
def _check_return_at_the_end(self, node): """Check for presence of a *single* return statement at the end of a function. "return" or "return None" are useless because None is the default return type if they are missing. NOTE: produces a message only if there is a single ret...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,879
add_message
ref
function
self.add_message("useless-return", node=node)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,882
add_message
ref
function
self.add_message("useless-return", node=node)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,884
_check_unnecessary_dict_index_lookup
def
function
def _check_unnecessary_dict_index_lookup( self, node: nodes.For | nodes.Comprehension ) -> None: """Add message when accessing dict values by index lookup.""" # Verify that we have an .items() call and # that the object which is iterated is used as a subscript in the # bo...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,897
safe_infer
ref
function
inferred = utils.safe_infer(node.iter.func)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,900
as_string
ref
function
iterating_object_name = node.iter.func.expr.as_string()
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,908
get_children
ref
function
node.body if isinstance(node, nodes.For) else node.parent.get_children()
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,911
nodes_of_class
ref
class
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,937
as_string
ref
function
or iterating_object_name != subscript.value.as_string()
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,951
add_message
ref
function
self.add_message(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,954
as_string
ref
function
args=(node.target.elts[1].as_string()),
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,962
as_string
ref
function
or iterating_object_name != subscript.value.as_string()
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,978
safe_infer
ref
function
inferred = utils.safe_infer(value.slice)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,981
add_message
ref
function
self.add_message(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,984
as_string
ref
function
args=("1".join(value.as_string().rsplit("0", maxsplit=1)),),
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
1,987
_check_unnecessary_list_index_lookup
def
function
def _check_unnecessary_list_index_lookup( self, node: nodes.For | nodes.Comprehension ) -> None: if ( not isinstance(node.iter, nodes.Call) or not isinstance(node.iter.func, nodes.Name) or not node.iter.func.name == "enumerate" or not isinstance(no...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
2,011
get_children
ref
function
node.body if isinstance(node, nodes.For) else node.parent.get_children()
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
2,014
nodes_of_class
ref
class
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
2,033
as_string
ref
function
or iterating_object_name != subscript.value.as_string()
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py
pylint/checkers/refactoring/refactoring_checker.py
2,054
add_message
ref
function
self.add_message(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
70
LineSpecifs
def
class
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
86
CplSuccessiveLinesLimits
def
class
__init__
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
109
LinesChunk
def
class
__init__ __eq__ __hash__ __repr__ __str__
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
118
Index
ref
function
self._index: Index = Index(num_line)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
144
SuccessiveLinesLimits
def
class
__init__ start end end __repr__
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
157
start
def
function
def start(self) -> LineNumber: return self._start @property def end(self) -> LineNumber: return self._end @end.setter def end(self, value: LineNumber) -> None: self._end = value def __repr__(self) -> str: return f"<SuccessiveLinesLimits <{self._start};{self._en...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
161
end
def
function
def end(self) -> LineNumber: return self._end @end.setter def end(self, value: LineNumber) -> None: self._end = value def __repr__(self) -> str: return f"<SuccessiveLinesLimits <{self._start};{self._end}>>"
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
165
end
def
function
def end(self, value: LineNumber) -> None: self._end = value def __repr__(self) -> str: return f"<SuccessiveLinesLimits <{self._start};{self._end}>>"
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
172
LineSetStartCouple
def
class
__repr__ __eq__ __hash__ increment
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
194
increment
def
function
def increment(self, value: Index) -> LineSetStartCouple: return LineSetStartCouple( Index(self.fst_lineset_index + value), Index(self.snd_lineset_index + value), )
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
195
LineSetStartCouple
ref
function
return LineSetStartCouple(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
196
Index
ref
function
Index(self.fst_lineset_index + value),
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
197
Index
ref
function
Index(self.snd_lineset_index + value),
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
204
hash_lineset
def
function
def hash_lineset( lineset: LineSet, min_common_lines: int = DEFAULT_MIN_SIMILARITY_LINE
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
236
Index
ref
function
index = Index(index_i)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
237
SuccessiveLinesLimits
ref
function
index2lines[index] = SuccessiveLinesLimits(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
238
LineNumber
ref
function
start=LineNumber(start_linenumber), end=LineNumber(end_linenumber)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
238
LineNumber
ref
function
start=LineNumber(start_linenumber), end=LineNumber(end_linenumber)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
241
LinesChunk
ref
function
l_c = LinesChunk(lineset.name, index, *succ_lines)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
247
remove_successive
def
function
def remove_successive(all_couples: CplIndexToCplLines_T) -> None: """Removes all successive entries in the dictionary in argument. :param all_couples: collection that has to be cleaned up from successive entries. The keys are couples of indices that mark the beginning of common entries ...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
275
increment
ref
function
test = couple.increment(Index(1))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
275
Index
ref
function
test = couple.increment(Index(1))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
281
increment
ref
function
test = test.increment(Index(1))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
281
Index
ref
function
test = test.increment(Index(1))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
290
filter_noncode_lines
def
function
def filter_noncode_lines( ls_1: LineSet, stindex_1: Index, ls_2: LineSet, stindex_2: Index, common_lines_nb: int,
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
324
Commonality
def
class
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
334
Similar
def
class
__init__ append_stream run _compute_sims _display_sims _get_similarity_report _find_common _iter_sims get_map_data combine_mapreduce_data
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
358
append_stream
def
function
def append_stream( self, streamid: str, stream: STREAM_TYPES, encoding: str | None = None ) -> None: """Append a file to search for similarities.""" if isinstance(stream, BufferedIOBase): if encoding is None: raise ValueError readlines = decoding_s...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
365
decoding_stream
ref
function
readlines = decoding_stream(stream, encoding).readlines
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
375
LineSet
ref
function
LineSet(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
388
run
def
function
def run(self) -> None: """Start looking for similarities and display results on stdout.""" if self.namespace.min_similarity_lines == 0: return self._display_sims(self._compute_sims()) def _compute_sims(self) -> list[tuple[int, set[LinesChunkLimits_T]]]: """Compute si...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
392
_display_sims
ref
function
self._display_sims(self._compute_sims())
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
392
_compute_sims
ref
function
self._display_sims(self._compute_sims())
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
394
_compute_sims
def
function
def _compute_sims(self) -> list[tuple[int, set[LinesChunkLimits_T]]]: """Compute similarities in appended files.""" no_duplicates: dict[int, list[set[LinesChunkLimits_T]]] = defaultdict(list) for commonality in self._iter_sims(): num = commonality.cmn_lines_nb linese...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
398
_iter_sims
ref
function
for commonality in self._iter_sims():
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
433
_display_sims
def
function
def _display_sims( self, similarities: list[tuple[int, set[LinesChunkLimits_T]]] ) -> None: """Display computed similarities on stdout.""" report = self._get_similarity_report(similarities) print(report) def _get_similarity_report( self, similarities: list[tuple[int,...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
437
_get_similarity_report
ref
function
report = self._get_similarity_report(similarities)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
440
_get_similarity_report
def
function
def _get_similarity_report( self, similarities: list[tuple[int, set[LinesChunkLimits_T]]] ) -> str: """Create a report from similarities.""" report: str = "" duplicated_line_number: int = 0 for number, couples in similarities: report += f"\n{number} similar li...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
460
_find_common
def
function
def _find_common( self, lineset1: LineSet, lineset2: LineSet ) -> Generator[Commonality, None, None]: """Find similarities in the two given linesets. This the core of the algorithm. The idea is to compute the hashes of a minimal number of successive lines of each lineset and the...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
476
hash_lineset
ref
function
hash_to_index_1, index_to_lines_1 = hash_lineset(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
479
hash_lineset
ref
function
hash_to_index_2, index_to_lines_2 = hash_lineset(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
501
LineSetStartCouple
ref
function
LineSetStartCouple(index_1, index_2)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
502
CplSuccessiveLinesLimits
ref
function
] = CplSuccessiveLinesLimits(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
508
remove_successive
ref
function
remove_successive(all_couples)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
515
Commonality
ref
function
com = Commonality(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
525
filter_noncode_lines
ref
function
eff_cmn_nb = filter_noncode_lines(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
532
_iter_sims
def
function
def _iter_sims(self) -> Generator[Commonality, None, None]: """Iterate on similarities among all files, by making a Cartesian product. """ for idx, lineset in enumerate(self.linesets[:-1]): for lineset2 in self.linesets[idx + 1 :]: yield from self._find_co...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
538
_find_common
ref
function
yield from self._find_common(lineset, lineset2)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
540
get_map_data
def
function
def get_map_data(self): """Returns the data we can use for a map/reduce process. In this case we are returning this instance's Linesets, that is all file information that will later be used for vectorisation. """ return self.linesets def combine_mapreduce_data(self, lin...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
548
combine_mapreduce_data
def
function
def combine_mapreduce_data(self, linesets_collection): """Reduces and recombines data into a format that we can report on. The partner function of get_map_data() """ self.linesets = [line for lineset in linesets_collection for line in lineset]
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
556
stripped_lines
def
function
def stripped_lines( lines: Iterable[str], ignore_comments: bool, ignore_docstrings: bool, ignore_imports: bool, ignore_signatures: bool, line_enabled_callback: Callable[[str, int], bool] | None = None,
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
575
parse
ref
function
tree = astroid.parse("".join(lines))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
590
_get_functions
def
function
def _get_functions( functions: list[nodes.NodeNG], tree: nodes.NodeNG ) -> list[nodes.NodeNG]: """Recursively get all functions including nested in the classes from the tree.""" for node in tree.body: if isinstance(node, (nodes.FunctionDef, nodes.Asyn...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
603
_get_functions
ref
function
_get_functions(functions, node)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
607
_get_functions
ref
function
functions = _get_functions([], tree)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
623
line_enabled_callback
ref
function
if line_enabled_callback is not None and not line_enabled_callback(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
652
LineSpecifs
ref
function
LineSpecifs(text=line, line_number=LineNumber(lineno - 1))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
652
LineNumber
ref
function
LineSpecifs(text=line, line_number=LineNumber(lineno - 1))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
658
LineSet
def
class
__init__ __str__ __len__ __getitem__ __lt__ __hash__ __eq__ stripped_lines real_lines
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
677
stripped_lines
ref
function
self._stripped_lines = stripped_lines(
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
707
stripped_lines
def
function
def stripped_lines(self): return self._stripped_lines @property def real_lines(self): return self._real_lines
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
711
real_lines
def
function
def real_lines(self): return self._real_lines
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
726
report_similarities
def
function
def report_similarities( sect, stats: LinterStats, old_stats: LinterStats | None,
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
733
table_lines_from_stats
ref
function
lines += table_lines_from_stats(stats, old_stats, "duplicated_lines")
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
734
Table
ref
function
sect.append(Table(children=lines, cols=4, rheaders=1, cheaders=1))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
738
SimilarChecker
def
class
__init__ open process_module close get_map_data reduce_map_data
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
815
reset_duplicated_lines
ref
function
self.linter.stats.reset_duplicated_lines()
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
817
process_module
def
function
def process_module(self, node: nodes.Module) -> None: """Process a module. the module's content is accessible via the stream object stream must implement the readlines method """ if self.linter.current_name is None: warnings.warn( ( ...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
832
stream
ref
function
with node.stream() as stream:
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
833
append_stream
ref
function
self.append_stream(self.linter.current_name, stream, node.file_encoding) # type: ignore[arg-type]
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
840
_compute_sims
ref
function
for num, couples in self._compute_sims():
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
851
add_message
ref
function
self.add_message("R0801", args=(len(couples), "\n".join(msg)))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
856
get_map_data
def
function
def get_map_data(self): """Returns the data we can use for a map/reduce process. In this case we are returning this instance's Linesets, that is all file information that will later be used for vectorisation. """ return self.linesets def combine_mapreduce_data(self, lin...
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
858
get_map_data
ref
function
return Similar.get_map_data(self)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
860
reduce_map_data
def
function
def reduce_map_data(self, linter, data): """Reduces and recombines data into a format that we can report on. The partner function of get_map_data() """ Similar.combine_mapreduce_data(self, linesets_collection=data)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
865
combine_mapreduce_data
ref
function
Similar.combine_mapreduce_data(self, linesets_collection=data)
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
868
register
def
function
def register(linter: PyLinter) -> None: linter.register_checker(SimilarChecker(linter))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
869
register_checker
ref
function
linter.register_checker(SimilarChecker(linter))
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/similar.py
pylint/checkers/similar.py
869
SimilarChecker
ref
function
linter.register_checker(SimilarChecker(linter))