Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I found what it generates.

https://github.com/pediredla/Algorithms/pull/3/files

It looks like a linter, but maybe there is more.



I've never seen a linter tell me problems with code in this detail before:

> You are using a `ConcurrentHashMap`, but your usage of `get()` and `put()` may not be thread-safe at lines: 110, 113, 135, and 137. Two threads can perform this same check at the same time and one thread can overwrite the value written by the other thread.


Many linters are state-aware, for example to catch use-before-init bugs in various languages.

This one could be a fairly simple rule ConcurrentHashMap.get() followed by some code that branches on the result, followed by put() is unsafe. These warnings can be very helpful, but no fairy ML magic needed.


Pretty sure you can turn on that inspection in IntelliJ. The other ones are much more impressive. The 'waiters' one for instance is gold.


staticccheck for Go does _some_ of this kind of thing (documenting improper usage). https://staticcheck.io/docs/checks


SonarQube does as well. I've been shocked at some of the analysis it does.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: