A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.codecov.com/docs/static-analysis below:

Static Analysis for Automated Test Selection

Static Analysis is the process used by Codecov to extract information from your code. We never store the code itself, only certain metrics and relationships between lines of code.

Static Analysis is powered by TreeSitter, a well-known and performant parser generator tool. This process happens in your CI. The processing results are uploaded to Codecov.

For every file, much like git does, we hash the contents of it and use that to index the file snapshot. So if we have static analysis information of your code base you only need to upload new information for the files that have been changed effectively. This means that across multiple commits only few files will need to be uploaded.

To use ATS Codecov needs the static analysis information to exist for the two commits being compared. If you want to use ATS we recommend you run static analysis in all your commits. Check Getting Started with ATS - General guide for more details on integrating ATS.

List of languages supported by static analysis.

To use the static analysis you have to use the static-analysis command of the Codecov CLI.

This command searches for files to be analyzed, runs the analysis locally. Then it checks with Codecov what files need to be uploaded and uploads the results that need to be updated to Codecov. If the file snapshot saved in Codecov is up-to-date it will not be uploaded again (unless --force is used).

Usage: codecovcli static-analysis [OPTIONS]

Options:
  --foldertosearch PATH      Folder to search
  --numberprocesses INTEGER  number of processes to use
  --pattern TEXT             file pattern to search for
  --force / --no-force
  --commit-sha TEXT          Commit SHA (with 40 chars)  [required]
  --folders-to-exclude PATH  Folders not to search
  --token TEXT               The static analysis token (NOT the same token as
                             upload)  [required]
  -h, --help                 Show this message and exit.

Above are the list of options for the static-analysis command.

You can speed up the static-analysis command by restricting the number of files that it analyses. By using a combination of foldertosearch, folders-to-exclude and pattern.

Let's consider the example below.

my project
└── apps/
    ├── my_app/
    │   └── tests
    ├── my_other_app/
    │   └── tests
    ├── shared/
    │   └── tests
    └── experimental

Suppose that I'm only using ATS in my_app, and that my_app uses some of the code in shared. In this case I could use static-analysis only in my_app and its subfolders and shared. One option to accomplish that could be as below.

$ codecovcli static-analysis \
	--folders-to-exclude=apps/my_other_app
	--folders-to-exclude=apps/experimental

Updated 9 months ago


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4