Please provide
- Operating system: MacOS 10.15.7 (19H1615)
- SonarLint plugin version: 7.4.0.60471
- Programming language you’re coding in: Python 3.11.1
- Is connected mode used: No
- Connected to SonarCloud or SonarQube (and which version): N/A
class LinkedListNode:
def __init__(self):
self.next = None
self.prev = None
def __insert_next(self, node):
node.next = self.next
node.prev = self
self.next.prev = node
self.next = node
def add_after_first_node(self, node, new_node):
while node.prev is not None:
node = node.prev
node.__insert_next(new_node)
Expected: No issues reported.
Actual:
For the last line in the code snippet above, sonarlint reports:
Remove this unused class-private ‘__insert_next’ method.
If the last line is changed to:
self.__insert_next(new_node)
then the issue goes away.