

PySonar: an Advanced Static Analyzer for Python - handsomegui
http://yinwang0.wordpress.com/2010/09/12/pysonar/

======
sqs
Yin Wang is awesome and his work on programming languages and type inference
is super impressive. We've been using his PySonar (v1) to build a global index
of Python code and it works far better than we or anyone would have expected,
for a dynamic language.

Here are some examples of what PySonar can do:

* Python stdlib, sorted by most-used functions: [https://sourcegraph.com/hg.python.org/cpython](https://sourcegraph.com/hg.python.org/cpython)

* Finding everywhere a function is used: [https://sourcegraph.com/hg.python.org/cpython/symbols/python...](https://sourcegraph.com/hg.python.org/cpython/symbols/python/Lib/logging/getLogger)

* All usages of the Django URL render_to_response function: [https://sourcegraph.com/github.com/django/django/symbols/pyt...](https://sourcegraph.com/github.com/django/django/symbols/python/django/shortcuts/render_to_response)

* All usages of the Flask @app.route decorator: [https://sourcegraph.com/github.com/mitsuhiko/flask/symbols/p...](https://sourcegraph.com/github.com/mitsuhiko/flask/symbols/python/flask/app/Flask/route)

This is all done using PySonar v1-based static analysis on Python code.
PySonar v2 is even better.

------
horia_
Very cool!

From a pragmatic perspective, I'd like to see an extension of this that
enables me to ask PySonar to insert some validation magics in my functions and
object methods to enforce the caller to use the appropriate types.

------
handsomegui
Which is now open-sourced at:
[https://github.com/yinwang0/pysonar2](https://github.com/yinwang0/pysonar2)

