parazeeknova / nyxtext

Consider decorating method with @staticmethod PYL-R0201
Performance
Major
2 months ago6 months old
Method doesn't use the class instance and could be converted into a static method
 76        self.fsobjects: dict[str, Path] = {}
 77        self.load_tree(Path(Path(sys.executable).anchor))
 78
 79    def safe_iterdir(self, path: Path) -> tuple[Path, ...] | tuple[()]: 80        """
 81        Like `Path.iterdir()`, but do not raise on permission errors.
 82        """
Method doesn't use the class instance and could be converted into a static method
317    def change_appearance_mode_event(self, new_appearance_mode: str):
318        set_appearance_mode(new_appearance_mode)
319
320    def seperator(self, frame, side) -> None:321        seperator = CTkLabel(frame, text="|")
322        seperator.pack(side=f"{side}", padx=4, pady=2)
323        seperator.configure(width=2, font=("Arial", 16, "bold"), fg_color="transparent")
Method doesn't use the class instance and could be converted into a static method
314    def open_settings_window(self):
315        self.settings = Settings(self)
316
317    def change_appearance_mode_event(self, new_appearance_mode: str):318        set_appearance_mode(new_appearance_mode)
319
320    def seperator(self, frame, side) -> None:
Method doesn't use the class instance and could be converted into a static method
52        text_area.insert("1.0", file_content)
53        return new_tab
54
55    def read_file_content(self, filepath):56        with open(filepath, "r") as file:
57            content = file.read()
58        return content