HTML5 and JavaScript - 2.3
Description
The HTML5/JavaScript Analyzer can be used if your application is a Web Application, has HTML/JavaScript/CSS files and/or contains HTML/JavaScript fragments embedded into JEE and .NET files (for example). The analyzer provides the following features:
- Checksum, number of code lines, number of comment lines, comments are present.
- Local and global resolution is done when function is called directly through its name (inference engine resolution is not available).
- For global resolution, caller is searched in all .js files. If only one callee is found, a link is created. If several callees are found, the analyzer watches inclusions in html files to see if it can filter the callee. If nothing is found in html files to filter, links are created to all possible callees.
- Automated Function Point counting.
Technology support
See HTML5 and JavaScript - Technical Notes for information about:
- Web Services support
- Marionette with Backbone framework support
- Apache Tiles framework support
- Handlebars support
- Apache Tapestry framework support
- JSP/Classic ASP/JavaScript notes
Files analyzed
| Icon(s) | File | Extension | Notes |
|---|---|---|---|
| HTML | *.html, *.htm, *.xhtml, *.ftl; *.ftlh; *.vm, *.ngt, *.vt, *.vtl *.tml, *.mustache, *.njk, *.nunjucks, *.liquid, *.ejs, *.jst *.shtml, *.sshtml, *.ssi, *.shtm, *.stm |
Supports HTML/XHTML versions 1 - 5. Creates one "HTML5 Source Code" object that is the caller of html to js links and a transaction entry point Broadcasts tags and attributes/values to other CAST extensions such as com.castsoftware.angularjs. Other extensions will not need to analyze the files themselves. *.ftl files are supported in releases ≥ 2.1.24-funcrel. *.ftlh, *.vm files are supported in releases ≥2.1.25-funcrel. *.ngt, *.vt, *.vtl files are supported in releases ≥ 2.1.28-funcrel and CAIP ≥ 8.3.54. *.tml, *.mustache, *.njk, *.nunjucks, *.liquid, *.ejs, *.jst, *.shtml, *.sshtml, *.ssi, *.shtm, *.stm files are supported in releases ≥ 2.2.1-funcrel and CAIP ≥ 8.3.54. |
|
| JavaScript | *.js, *.jsx, *.mjs, *.jsm, *.cjs, *.es6 | Supports JavaScript 1 to 1.8.1. Supports JavaScript ECMA 6 *.jsm files are supported in releases ≥ 2.1.23-funcrel. *.cjs files are supported in releases ≥2.1.27-funcrel. *.es6 files are supported in releases ≥ 2.3.18-funcrel. |
|
| Cascading Style Sheet | *.css, *.scss *.less','*.sass', '*.styl', '*.stylus', '*.cssm', '*.pcss', '*.postcss |
Supports CSS 1 - 3. *.less','*.sass', '*.styl', '*.stylus', '*.cssm', '*.pcss', '*.postcss files are supported in releases ≥ 2.1.29-funcrel and CAIP ≥ 8.3.54. |
|
| Java Server Page | *.jsp, *.jspx, *.jsf, *.jsff, *.jspf, *.jsi, *.tag, *.tags, *.tagf, *.tagx | Supports JSP 1.1 - 2.3. |
|
| Active Server Page | *.asp, *.aspx, *.ascx | See also HTML5 and JavaScript - Technical Notes. | |
| HTML Components | *.htc | HTC files contain html, JavaScript fragments that will be parsed. Created objects will be linked to the HTC file. | |
| ASP.NET MVC Razor | *.cshtml | See also HTML5 and JavaScript - Technical Notes | |
| Blazor | *.razor | Files related to Blazor. | |
| IBM EAD4J Jade | *.jade | Files related to the IBM EAD4J Jade framework. | |
| Pug | *.pug | Pug files. | |
| Haml | *.haml | Haml files are supported in releases ≥ 2.2.1-funcrel and CAIP ≥ 8.3.54. | |
| - | YAML (YAML Ain't Markup Language) | *.yml, *.yaml, | Files related to the YAML language, handled by the com.castsoftware.nodejs extension. |
| - | Vue.JS | *.vue | Files related to the Vue.js JavaScript language, handled by the com.castsoftware.nodejs and com.castsoftware.vuejs extensions. |
| - | Properties | *.properties | - |
| - | Template | *.template | Files related to serverless.template, handled by the com.castsoftware.nodejs extension. |
| Handlebars | *.hbs, *.handlebars | Files related to Handlebars.js. See Specific case of handlebars file below. |
You may find that the number of files delivered is more than then number of files reported after analysis. This is due to the following:
- by default some files are automatically excluded from the analysis, typically third-party frameworks which are not required. Please see the filters.json file located at the root of the extension folder for a complete list of default exclusions.
- some bundled javascript files are automatically excluded from the analysis, typically minified files
extension.min.jsor disguised minified filesextension.js, but for files containing one or a few very long lines, a specific calculation is actioned by the analyzer. - some files that have been included in the analysis may not be saved in the CAST Analysis Service schema because they do not contain any useful information, i.e. they do not contain any technical sections such as functions which would lead to the creation of a specific object.
Since version 2.1.14-funcrel, files which are excluded from analysis are considered as external libraries when they are included in analyzed code. For each file, a “HTML5 JavaScript Source Code” is created with the external property set to “True”. This means that these files are not included in rule checks or other computations.
Transactions
Transaction support is derived from metamodel concepts used to build CAST Imaging Blueprint and structural transaction flows. Entry Points start transactions; Exit Points include both output/boundary concepts and Data Entities manipulated by transactions.
| Role | Support | Breakdown |
|---|---|---|
| Entry Point |
|
|
| Exit Point |
Unresolved Storage
|
Data version: 2.3.20-funcrel
ISO 5055 Structural Rules
Quality support is based on ISO 5055 structural rules available for the selected extension version.
| Reliability | Maintainability | Security | Performance Efficiency |
|---|---|---|---|
Data version: 2.3.20-funcrel
Download and installation instructions
For HTML5 web applications, the extension will be automatically installed by CAST Imaging Console:

What results can you expect?
Example application

Javascript ECMA6 Classes and Constructors example:

Objects
Quality rules
- 2.3.20-funcrel
- 2.3.19-funcrel
- 2.3.18-funcrel
- 2.3.17-funcrel
- 2.3.16-funcrel
- 2.3.15-funcrel
- 2.3.14-funcrel
- 2.3.13-funcrel
- 2.3.12-funcrel
- 2.3.11-funcrel
- 2.3.10-funcrel
- 2.3.9-funcrel
- 2.3.8-funcrel
- 2.3.7-funcrel
- 2.3.6-funcrel
- 2.3.5-funcrel
- 2.3.4-funcrel
- 2.3.3-funcrel
- 2.3.2-funcrel
- 2.3.1-funcrel
- 2.3.0-funcrel
A global list is also available here: https://technologies.castsoftware.com/AIP/technologies/1020000 .
Known Limitations
- Creation and detection of object using “prototype” is not supported.
- When HTML5/JavaScript source code is used as the “source” or “destination” in a Reference Pattern it will be ignored when the analysis is run - this is due to a limitation in the way the analyzer functions.