Is There a Static Analysis Tool for Python, Ruby, SQL, Cobol, Perl, and Pl/Sql

PL/SQL pre-compile and Code Quality checks in an automated build environment?

I think that this blog describes the needed process:

http://www.theserverlabs.com/blog/?p=435

Please check and let me know what you think about it.

Ruby source code analyzer (something like pylint)

I reviewed a bunch of Ruby tools that are available here

http://devver.wordpress.com/2008/10/03/ruby-tools-roundup/

most of the tools were mentioned by webmat, but if you want more information I go pretty in depth with examples.

I also highly recommend using Metric-Fu it gives you a on gem/plugin install of 3 of the more popular tools and is built with cruisecontrolrb integration in mind.

The creator has a great post that should help get you up and running in no time.

http://jakescruggs.blogspot.com/2008/04/dead-simple-rails-metrics-with-metricfu.html

There has been a lot of activity in Ruby tools lately which I think is a good sign of a growing and maturing language.

.NET: Which Exception to Throw When a Required Configuration Setting is Missing?

You're not limited in your exception-throwing to existing exceptions in the Framework. If you do decide to use existing exceptions, you don't absolutely have to follow the documentation to the letter. The documentation will describe how the framework uses a given exception, but doesn't imply any limitation on how you choose to use/reuse an existing exception.

It's your application- as long as you document it and clearly indicate the exception that will be thrown in the specific case of a missing configuration value, you can use any exception you like. If you do want a very specific indication of a missing value, you might consider writing your own ConfigurationSettingMissing exception:

[Serializable]
public class ConfigurationMissingException : ConfigurationErrorsException
{}

EDIT: Writing your own exception in this case carries the added benefit of guaranteeing that there will never be any confusion regarding where the exception is coming from- the framework, or your application. The framework will never throw your custom exceptions.

UPDATE: I agree with the comments, so I have changed the subclass to ConfigurationErrorsException from Exception. I think it's generally a good idea to subclass custom exceptions from existing Framework exceptions where possible, avoiding the Exception class unless you need an application-specific exception.

How can I analyze Python code to identify problematic areas?

For measuring cyclomatic complexity, there's a nice tool available at traceback.org. The page also gives a good overview of how to interpret the results.

+1 for pylint. It is great at verifying adherence to coding standards (be it PEP8 or your own organization's variant), which can in the end help to reduce cyclomatic complexity.

How to build a pep8 like static analysis tool for Django?

There are two open source projects that I know of which do this type of analysis speficially for Django:

  • django-lint which is a wrapper/extension to PyLint
  • djangolint which is a Django Dash project which appears to have it's own set of analyizers

Either one should provide a solid starting point for what you are looking to do.

Write custom code analysis tool for Python/Pydev?

You can extend PyDev itself: grab its code and do some analysis with it. At the code-level: com.python.pydev.analysis.OccurrencesAnalyzer is the starting place (to get the code: http://www.pydev.org/developers.html).

It already has ways of parsing the code to get the AST with a visitor structure you can use for the analysis.

For simpler checks you could just improve upon the pep8.py that's distributed in PyDev itself (/org.python.pydev/pysrc/third_party/pep8/pep8.py).



Related Topics



Leave a reply



Submit