Analyzing Java code

Purpose

The Java analyzer is intended to analyse dependencies between Java types. It use a Jdeps output file as input. The element hierarchy is based on types and namespaces.

Pre requisites

Performing an analysis

Command line usage

Use the following command to run JDeps (ArgoUML analysis example):

"C:\Program Files\Java\jdk1.8.0_161\bin\jdeps" -verbose:class -recursive -dotoutput D:\DsmAnalysis\Java\ArgoUml\JdepsOutput D:\DsmAnalysis\Java\ArgoUml\Binaries\argouml.jar 

Use the following command to run a analysis using the JDeps output file:

"C:\Program Files\DsmSuite\Analyzers\Java\DsmSuite.Analyzer.Jdeps.exe" AnalyzerSettings.xml

Note: You can also analyze Android projects by converting the APK file into JAR files using DEX2JAR.

Settings

The following settings are defined:

Setting Description
LogLevel Log level as described above
Input.DotFileDirectory Directory containing Jdeps .dot file used to extract dependency information
Transformation.IgnoredNames Names in input data which will be ignore. Defines as regular expression.
Output.Filename Filename with dsi extension to which results will be written
Output.Compress Compress output file

AnalyzerSettings.xml example

An example settings file is shown below (ArgoUML analysis example):

<?xml version="1.0" encoding="utf-8"?>
<AnalyzerSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <LogLevel>Error</LogLevel>
  <Input>
    <DotFileDirectory >JdepsOutput</DotFileDirectory >
  </Input>
  <Transformation>
    <IgnoredNames />
  </Transformation>
  <Output>
    <Filename>argouml.dsi</Filename>
    <Compress>true</Compress>
  </Output>
</AnalyzerSettings>

Additional Logging

No additional logging files defined.

back