Performing analysis using the command line

Analyze allows running source code and binary analysis using analyzer-lsp.

To run analysis on application source code, run the following command:
{mta-cli} analyze --input=<path/to/source/code> --output=<path/to/output/dir>

All flags:

Analyze application source code

Usage:
  {mta-cli} analyze [flags]

Flags:
      --analyze-known-libraries   analyze known open-source libraries
  -h, --help                      help for analyze
  -i, --input string              path to application source code or a binary
      --json-output               create analysis and dependency output as json
      --list-sources              list rules for available migration sources
      --list-targets              list rules for available migration targets
  -l, --label-selector string     run rules based on specified label selector expression
      --maven-settings string     path to a custom maven settings file to use
      --overwrite                 overwrite output directory
      --skip-static-report        do not generate the static report
  -m, --mode string               analysis mode. Must be one of 'full' or 'source-only' (default "full")
  -o, --output string             path to the directory for analysis output
      --rules stringArray         filename or directory containing rule files
      --skip-static-report        do not generate the static report
  -s, --source string             source technology to consider for analysis. To specify multiple sources, repeat the parameter: --source <source_1> --source <source_2> etc.
  -t, --target string             target technology to consider for analysis. To specify multiple targets, repeat the parameter: --target <target_1> --target <target_2> etc.

Global Flags:
      --log-level uint32   log level (default 4)
      --no-cleanup         do not cleanup temporary resources
Usage example
  1. Get an example application to run analysis on.

  2. List available target technologies.

    {mta-cli} analyze --list-targets
  3. Run an analysis with a specified target technology, for example cloud-readiness.

    {mta-cli} analyze --input=<path-to/example-applications/example-1> --output=<path-to-output-dir> --target=cloud-readiness
  4. Several analysis reports are created in your specified output path:

    $ ls ./output/ -1
    analysis.log
    dependencies.yaml
    dependency.log
    output.yaml
    static-report

output.yaml is the file that contains the issues report.

static-report contains the static HTML report.

dependencies.yaml contains a dependencies report.