Kwjsspecimport

If you're already analyzing your projects and have a '.eslintrc' file available, you can use this tool to help you get setup with Klocwork Static Analysis more quickly since it takes care of much of the configuration. In order to see any JavaScript-related issues, you need to import one of the provided JavaScript taxonomies.

This command produces a JavaScript build specification options file based on the '.eslintrc' file you point it to, and produces a .pconf file based on the eslint checkers that are enabled in your '.eslintrc' file. This options file can be used in kwjsspec command to create the JavaScript build specification file.

Note: When running this script, you need to use python3; you can also use the instance installed in your 'C:\Klocwork\Server 22.3\python3\python' folder.

Prerequisites

  • Node Js version needs to be version 10 or newer.

  • Eslint version needs to be version 8.20.0 or newer.

Note: These prerequisities are only required if you need to generate the 'eslintrc' file. If you have your configuration file already, you can ignore this section.

Usage

python kwjsspecimport.py [<options>]

where <options> are any arguments required for your build.

Examples

python kwjsspecimport.py -c <path-to-configfile>
C:\Klocwork\Server 22.3\python3\python kwjsspecimport.py -c <path-to-config-file> --pconf-file-name <pconf-file-name> --options-file-name <options file name>

Options

Name (and short name) Description
--help (-h) display help
--config-file (-c)

specifies the Javascript '.eslintrc' configuration file you want to use as the basis for your Klocwork build specification. The following configuration file formats are supported:

  • .eslintrc.js

  • .eslintrc.cjs

  • .eslintrc.yaml

  • .eslintrc.yml

  • .eslintrc.json

  • package.json

--options-file-name (-o) specify the kwjsspec options file name (the default is 'kwjsspec.opt')
--pconf-file-name (-p) specify the pconf file name (the default is 'analysis_profile.pconf')
--file (-f) specify the file or folder(s) you want to analyze