Page tree
Skip to end of metadata
Go to start of metadata

Some kiuwan users may need to locally analyze their source code in a computer that has no access to the internet. This usually happens in companies that develop sensitive applications or have strict security policies.

Kiuwan Local Analyzer offers to these users the deferred analysis mode, which is a special case of a command line analysis.

A deferred analysis consists of three phases:

  1. An online initialization phase. In this phase Kiuwan Local Analyzer needs to be connected to the internet, so it can download the needed configuration to analyze offline the user's applications.
  2. An offline analysis phase, where the user can launch analyses without the need of an internet connection. Results will be stored locally waiting to be uploaded in the third phase.
  3. An online upload phase, where the stored results will be uploaded to Kiuwan.

How to analyze in deferred mode

The initialization phase

You can launch the first phase of a deferred analysis in the same computer you have downloaded Kiuwan Local Analyzer or any other computer connected to the internet.

  • Open a console and change the directory to Kiuwan Local Analyzer bin directory:
        C:\Users\Jerry>cd \KiuwanLocalAnalyzer
        C:\KiuwanLocalAnalyzer>cd bin
  • Configure your username and password:
        C:\KiuwanLocalAnalyzer\bin>agent.cmd -e
  • Execute the init phase:
        C:\KiuwanLocalAnalyzer\bin>agent.cmd --defer-init
        Downloading user configuration, please wait...
        4 applications found, downloading data...
        Configuration downloaded successfully for application "testApp1", modelId = 652
        Configuration downloaded successfully for application "testApp2", modelId = 652
        Configuration downloaded successfully for application "testApp3", modelId = 652
        Configuration downloaded successfully for application "testApp4", modelId = 652
        Getting license for user...
        Saving user application configuration...
        Saving configuration for application "testApp1" (401)...
        Saving configuration for application "testApp2" (301)...
        Saving configuration for application "testApp3" (101)...
        Saving configuration for application "testApp4" (451)...
        Done - Configuration downloaded and saved successfully

Remember that you can also specify your user and password directly in the command line when launching the init phase:

C:\KiuwanLocalAnalyzer\bin>agent.cmd --defer-init --user jerry@jellyfish.com --password iamajellyfish

After the init phase has finished, Kiuwan Local Analyzer will have all the needed information to analyze offline.

The analysis phase

Once the initialization phase has been launched, you can take your Kiuwan Local Analyzer copy to the not connected computer where the source code resides. You must copy all the contents of the Kiuwan Local Analyzer folder (in our example, everything under C:\KiuwanLocalAnalyzer\).

Now you can analyze any of your applications launching an offline analysis:

[Not connected computer]:
C:\KiuwanLocalAnalyzer\bin>agent.cmd --defer-analyze -n testApp1 -s "C:\code\testApp1" -l myAnalysisLabel
Created dir: C:\KiuwanLocalAnalyzer\temp\testApp1.845799618
Task finished successfully.
Initializing analysis logger...
Analyzing software: testApp1
Analysis label:     myAnalysisLabel
Source paths:       c:\code\testsApp1
Include patterns:
Exclude patterns:   **/src/test/**,**/__MACOSX/**,**/*.min.js,**/*.Designer.vb,**/*Reference.vb
Create if needed:   false
Encoding:           UTF-8
Ignore steps:
Analyzing which technologies to process...
Technologies discovered: cobol
Checking analysis preconditions...
Technologies to analyze: cobol
-----------------------------------------------------
Executing rules analysis for technology cobol
-----------------------------------------------------
...

NOTE: Kiuwan Local Analyzer always tries to upgrade itself to the latest version available. If no connection is available, an error will be logged. You can ignore this error.

When you finish analyzing, copy again the contents of your Kiuwan Local Analyzer folder to a computer with internet connection.

The upload phase

Again in a connected computer, run the last step of the deferred mode:

C:\KiuwanLocalAnalyzer\bin>agent.cmd --defer-upload
Downloading user configuration, please wait...
4 applications found, downloading data...
Configuration downloaded successfully for application "testApp1", modelId = 652
Configuration downloaded successfully for application "testApp2", modelId = 652
Configuration downloaded successfully for application "testApp3", modelId = 652
Configuration downloaded successfully for application "testApp4", modelId = 652
Getting license for user...
Looking for analysis results for application "testApp1"...
  Uploading analysis results found in C:\KiuwanLocalAnalyzer\temp\testApp1.845799618\results with status OK...
  Analysis created in Kiuwan with code: A-7df-14fd524657d
Created dir: C:\KiuwanLocalAnalyzer\temp\uploaded\A-7df-14fd524657d
Moving 11 files to C:\KiuwanLocalAnalyzer\temp\uploaded\A-7df-14fd524657d
Looking for analysis results for application "testApp2"...
Looking for analysis results for application "testApp3"...
Looking for analysis results for application "testApp4"...
Saving user application configuration...
Saving configuration for application "testApp1" (401)...
Saving configuration for application "testApp2" (301)...
Saving configuration for application "testApp3" (101)...
Saving configuration for application "testApp4" (451)...
Upload done!
You can find your analysis results in kiuwan: https://www.kiuwan.com
Task finished successfully.

As you can see in the example log, the user configuration is downloaded again in this phase, so it is not needed to run the first step again to launch the next offline analyses.

Browsing the analysis results

After uploading an analysis result to Kiuwan, you can browse them by opening the kiuwan url:

https://www.kiuwan.com

Log in, select the analyzed application on the left tree and select one of the uploaded offline analysis results.

Summary

Kiuwan users can benefit from the local analysis advantages, specially when dealing with restricted access environments.

The deferred mode in Kiuwan Local Analyzer allows analyzing in computers without access to the internet.

The deferred mode consists of three phases: (online) initialization, (offline) analysis and (online) upload. The initialization phase needs to be run only the first time the deferred mode is used.

After executing the last phase you can browse in Kiuwan the results of your offline analyses.