Options

feature suggestion: Code sniffing

WeeeBobWeeeBob Posts: 16
edited March 15, 2013 12:27PM in SQL Prompt Previous Versions
Just a wee suggestion that I think would fit into SQL prompt quite well.

Hows about Code sniffing? For checking code compliance with user defined standards. Like checking column names conform to a defined standard, warnings on bad practices etc. You know all those little annoying things like no clustered index, use of cursors instead of set based ops, use of Select * or of Insert into tableA values (a,b,c).

All driven by user defined rules? With larger dev teams the standards docs always left to the side. If it could work on input and in some sort of batch mode (on sql source control check in?) it would be nice.

I've been looking around but unable to find any products like this for SQL server, there looks to be a good one for PHP though.

Comments

  • Options
    Anu DAnu D Posts: 876 Silver 3
    Many thanks for your post!

    We appreciate the requirement specified by you.

    Please feel free to add your vote or if there is one already kindly vote for it here.

    And then the project manager can directly decide what category this requirement comes under?
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Options
    SQLCop has a number of standard checks - things like SELECT * out of the box and I believe is open source.

    IIRC, RedGate's SQL Test can incorporate the standard SQL Cop validations in their own unit test class which can then be run within the tSQLt/SQL Test framework. As these tests are all written in SQL - it would be easy to extend.

    Another option might be to look at the work Dave Ballantyne has done one a powershell based code parser to look for the same dort of code smells
    "Your mind is like a parachute, it works best when open" Frank Zappa
    "Be wary of strong drink. It can make you shoot at tax collectors…and miss" Robert Heinlein
    blog: http://datacentricity.net
    twitter: @datacentricity
Sign In or Register to comment.