sisoe24 / nukeserversocket

Consider decorating method with @staticmethod PYL-R0201
Performance
Major
6 occurrences in this check
Method doesn't use the class instance and could be converted into a static method
 50
 51    def close(self): ...
 52
 53    def errorString(self) -> str: 54        return 'error'
 55
 56
Method doesn't use the class instance and could be converted into a static method
 45    def try_connect(self, port: int) -> bool:
 46        return True
 47
 48    def isListening(self) -> bool: 49        return False
 50
 51    def close(self): ...
Method doesn't use the class instance and could be converted into a static method
 42    def __init__(self, editor: MockEditorController, parent=None):
 43        super().__init__(parent)
 44
 45    def try_connect(self, port: int) -> bool: 46        return True
 47
 48    def isListening(self) -> bool:
Method doesn't use the class instance and could be converted into a static method
29    def __str__(self) -> str:
30        return pformat(self.data)
31
32    def load(self, settings_file: pathlib.Path) -> Dict[str, Any]:33        with settings_file.open() as f:
34            return json.load(f)
35
Method doesn't use the class instance and could be converted into a static method
 27    def __init__(self, settings: _NssSettings):
 28        self._settings = settings
 29
 30    def get_ip(self): 31        """Get the IP address of the current machine."""
 32        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 33        try:
Method doesn't use the class instance and could be converted into a static method
 81        output = self.editor.output_editor.toPlainText()
 82        return output[output.find('# Result:')+10:]
 83
 84    def _blink_wrapper(self, data: ReceivedData) -> str: 85        return dedent("""
 86            node = nuke.toNode("{filename}") or nuke.createNode('BlinkScript', 'name {filename}')
 87            knobs = node.knobs()