Summary: This section provides more detail about the support for specific ASP classic technologies and the way in which the they are supported.
Files contained within the <SCRIPT> tag without the "runat = server" attribute will be considered as containing client code only. This can cause syntax errors during the analysis if you have an ASP file contained within the <SCRIPT> tag. One possible solution is to ignore this type of coding by replacing the expression <SCRIPT src="XXX/XXX.asp" > with <SCRIPT> via the Text Replacement feature.
Source code and comment line counts
The number of lines of code (LOC) of a Web file is calculated according to the formula:
- #LOC in file = #lines in file - #empty lines - #comment lines
- When a scripting files is included for both the server side (using the tag <script runat=server> in one page) and the client side (using the tag <script> in another page), file level comments are counted twice. This affects also the #LOC of that file as it is calculated using the formula given in 1. However, the count for the class's sub-objects is correct.
- VBScript classes are not handled and therefore comments inside these classes are not seen. This affects the line count for code and comments in these files as it is calculated using the formula given in 1.
- Variable declarations are not handled. Therefore there are no comments associated with them.
If a file contains two distinct comment blocks on the same line and if there is part of a statement between the two blocks, CAST AIP counts two comment lines instead of one. In the following example, two lines are counted:
Implicit declaration of events
Implicit declaration of events is not supported. Thus such events are not displayed and no link to the procedure is found.
Jscript 3.0 - 5.6
- Precompilation is not supported.
- Jscript classes are represented as Jscript methods and there are no calling links between Jscript class members.
- Unexpected syntax error: unescaped script content.
- Object Literals are not supported.
- asp1.asp includes asp2.asp and myscript.js
- asp2.asp calls functions defined in myscript.js
- CAST AIP cannot detect Call links from asp2.asp to the js functions
The following section lists technical and functional aspects with regard to analysis of ASP source code:
Some additional links are provided in certain situations:
But less information in other situations:
- and the URI-like string does not match a file name.
Following warning is displayed during analysis:
Local variables having the same name as script language methods or functions
The following function will create a recursive link between the function falseLink and itself:
The following two functions will create a link between the function ""a and the function "falseLink":
Interdependencies between client-side code and server-side code
Because of the way in which the analyzer handles server-side code (i.e. code running on the web server) and client-side code (i.e. code executed in the web browser), an analysis may fail if the web file contains both types of code. The analyzer functions as follows:
- A page is first analyzed as server-side file and what is not recognized as server code is collected (preserving line and column numbers) in a buffer.
- The collected code is then considered and analyzed as client-side code.
This is syntactically incorrect. The error occurs on "Val2" and the analysis of the object containing the code fails. This limitation also applies even if server-side and client-side code appear on different lines in the same web file.
Syntax error on attribute value without opening double-quote
The analyzer produces a syntax error when encountering an HTML attribute inside a tag where the attribute value is closed by a double-quote but has no opening double-quote like in the following example:
Please note that:
- there is no double-quote before the 0
- this is incorrect syntax, however, it is tolerated by Internet Explorer
Restrictions on text length when using Text Replacements
When specifying regular expressions in the Text Replacement feature in the .NET analyzer, you must ensure that the new text has the same length as the replaced text. Otherwise, an analysis may fail. Note that the issue will occur during the Metrics Assistant phase of the analysis, although Text Replacement is configured in the relevant .NET Analysis Unit or at Application or Technology level.
Methods with the same name
If a web file includes directly or indirectly two js files and if several js or vbs script methods with the same name exist, a link will be drawn to all of the methods, when the methods are referenced in the code.