CMS Snapshot Analysis - Run Analyzer - Wrong objects - Web with extension - HTML5 and JavaScript - Wrong Javascript files

Description

When analyzing an application using HTML5/Javascript extension, some Javascript files are analyzed and present in Knowledge Base whereas they should not.

As explained in .NET - ASP.NET MVC Razor support files from third-party frameworks or tools should not be analyzed, as they are not part of user application.

But CAST AIP cannot know every tool or every framework on the market, and some might have been forgotten in the exclusion filters located in file filters.json

Observed in CAST AIP

ReleaseYes/No
8.3.x
8.2.x
8.1.x
8.0.x
7.3.x

Observed on RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS3
CSS2

Step by Step Scenario

  1. ServMan → Manage Extensions → install HTML5/Javascript extension on the triplet
  2. Create a user defined Universal Analysis Unit for HTML5/Javascript
  3. Run the analysis on javascript source code.

Action Plan

  1. Edit file filters.json located in the root folder of the extension (see  Obtain Extension), in order to add a new filter for the files you want to exclude
  2. Add a filter for the files you want to exclude :
    1. If the files you want to exclude contain a header with some copyright information, you might use a filter based on file content, like the following :

{ “type” : “FileContent”, “value” : “Google Maps” }

   2. If all the files you want to exclude contain the name of the framework they belong, then use a filter based on file path, like the following :

      ```text
{ "type" : "FilePath", "value" : "**/angular-*/**" }
  1. If not, then put them all in the same folder, and add a filter based on file path using the folder name. Most developers put their third-party files into a folder called vendor :

 { “type” : “FilePath”, “value” : “/vendor/” }

3. If the HTML and JavaScript objects are not from third party framework but from application and same objects are appearing more than once then you can use the attached [KBUpdatetool\_removeduplicateobjects.sql](https://doc-data.castsoftware.com/TG/attachments/566533703/566533702.sql) script to remove the duplicated objects.
4. Re-run analysis

**Impact on analysis**

Wrong values for most metrics

**Notes/comments**

Ticket # 10839

**Related Pages**

[CMS Snapshot Analysis - Run Analyzer - Missing objects - Web with extension - HTML5 and JavaScript](/export-v2/tg/technical-guides/technical-guides-by-cast-aip-component/cms-snapshot-analysis-component/cms-snapshot-analysis-run-analyzer/cms-snapshot-analysis-run-analyzer-missing-objects/cms-snapshot-analysis-run-analyzer-missing-objects-web-with-extension/cms-snapshot-analysis-run-analyzer-missing-objects-web-with-extension-html5-and-javascript/)