ASP bad script checker

Results 1 to 2 of 2

Thread: ASP bad script checker

  1. #1
    Join Date
    Dec 1969

    Default ASP bad script checker

    Has anybody ever created a script or com object that looks at an ASP script for syntax, and logic to validate that it's a good script? It would look at DB connections, variables, base logic, etc to ensure it's not a 'bad' script.

  2. #2
    Join Date
    Dec 1969

    Default There's a com object...

    ...called "vbscript.dll" that does most of that.<BR><BR>Yeah, VBScript itself. The compiler. Does a 100% check on syntax.<BR><BR>But I don&#039;t know of *any* code checker for *any* language that does anything worthwhile with the *semantics* of a program.<BR><BR>Just for example, you write code that uses a SQL string. The SQL is driven by data coming from a form on the prior page. Now, how in the world can a code checker plug in every possible value of something it might get from the prior page and validate all possible variations of the final SQL???<BR><BR>Code checkers are a dream that has been around for many years. And there are some that do a pretty good job of covering the basics. But none of them are perfect. If they were, don&#039;t you think that all the professional programmers would be using them and that you&#039;d never see any bugs in any major software product?<BR><BR>Anyway, VBScript is a tough language to work with, because pretty much "anything goes". It&#039;s perfectly legal, for example, to do:<BR><BR>&#060;%<BR>whatever = CInt( Request("bar") )<BR>If whatever &#062; 17 Then<BR> whatever = "Come to papa!"<BR>End If<BR>If Request("foo") &#060;&#062; "" Then<BR> Response.Write whatever / 12<BR>End If<BR>%&#062;<BR><BR>Now, how is the poor checker going to know whether or not that division will get an error??? Of foo on the form is *always* blank when bar is a number greater than 17, then there will never be an error. But could a code checker *presume* that? Hell, no.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts