Is there any static analysis tool which can help us detect memory leak cause by missing [weak self]?

I was wondering, is there any tool, which can help to detect memory leak caused by missing [weak self].

For instance, the following code contains memory leak issue caused by lack of [weak self]

class ImagePageViewController: UIPageViewController {

    lazy var memoryLeak = UIAction(
        title: "memory_leak",
        image: nil
    ) { _ in
        print(">>>> \(self)")

    override func viewDidLoad() {


Is there any tool which can help us to prevent such issue? I have tried GitHub - realm/SwiftLint: A tool to enforce Swift style and conventions. but it is not able to detect such.

While this is impossible to do statically in general case as you can do:

// one second later:
if foo(arguments) {
    self.memoryLeak = UIAction(title: "") { _ in } // break the cycle

hopefully static analyser could be improved to catch the majority of typical cases.