File-by-file analysis
The following sections describe the steps for the File-by-file Analysis method,
Which appears when you choose file by file analysis
.
It is done in two sequential steps:
- File filtering: select which files and folders to include in the analysis
- Content filtering: further refine the selected files by analyzing their contents
NOTE: Both filters are combined. Artemis will only include files that pass both filters.
Step 1: File filtering — select the code files to analyse
Under File Filtering
, you can choose which code files to include or exclude. This can be done in two ways:
-
Option 1: File filtering via File Explorer (manual selection)
-
Option 2: File filtering via Glob patterns (automatic selection). You can include or exclude files based on their file names using glob patterns.
Language | File Extensions |
---|---|
C++ | .cpp, .c, .h, .hpp, .cc, .hh, .cxx, .hxx, .c++, .h++, .cu, .cuh |
C | .c, .h |
Java | .java |
Python | .py |
Fortran | .f, .for, .f90, .f95, .f03, .f08, .F, .F90 |
JavaScript | .js, .jsx |
TypeScript | .ts, .tsx |
Ruby | .rb |
PHP | .php |
C# | .cs |
Go | .go |
Swift | .swift |
Kotlin | .kt, .kts |
Scala | .scala |
Rust | .rs |
Dart | .dart |
R | .r, .R |
Lua | .lua |
Perl | .pl, .pm |
SQL | .sql |
Q | .q |
COBOL | .cob, .cbl, .cpy |
OCaml | .ml |
Elixir | .ex |
Text | .txt, .md, .html, .css, .scss, .vue, .xml, .json, .yaml, .yml, .ini, .log, .conf, .cfg, .tsv, .rst, .tex, .bat, .sh, .pl, .toml, .properties, .gradle, .maven, .cmd, .awk, .env, .helm, .tpl, .kubeconfig, .npmrc, .prettierrc, .eslintrc, .babelrc, .terraformrc, .tfvars, .tf, .editorconfig, .gitignore, .gitconfig, .zshrc, .bashrc, .profile, .flake8, .pylintrc, .coveragerc, .drl, .m, .jl, .vba, .bas, .cls, .frm |
Unsupported | .csv |
Step 2: Content filtering — filter files by content and split large files
Under Content Filtering
, you can refine the selection further based on file contents.
- You can split large files by class or function. Each part will be extracted as a separate target.
- Options:
Function
,Class
, orFile
(entire file). - Click
Expand for content filters
for additional filtering options.
Content filtering: Advanced options
Advanced filtering can be done using:
- Regular expressions
- Size
- Tree-sitter structure
The Advanced Query Options
section only contains condition, criteria, and value fields, but filtering logic also depends on the code language and object dropdowns at the top. Each example below shows a complete query.
-
Regular expressions
-
Specify whether content should match or not match a regex.
-
Example:
Example queryCpp
Function
matches
regular expression
\bSumPrimes\s*\(
-
-
Size-based filtering
-
Filter content based on size (characters, words, or lines).
-
Example:
Example queryCpp
Class
has
size
>=
10
lines
-
-
Tree-sitter structure
-
Extract code structures such as
loop
ornested_loop
. -
Example:
Example queryCpp
Function
contains
treesitter structure
nested_loop
-
For more details, see the Tree-sitter library.
Content filtering with LLM
You can also filter code with an LLM query.
- Enable the
LLM Filtering
toggle.
- Optionally, set
target count
to limit how many targets are selected (e.g., 5 = top 5 inefficient files).
LLM-based filtering may produce false positives (targets that cannot actually be optimized).
View targets
After analysis, Artemis extracts targets according to your filters and shows them in the targets
tab.
Next steps:
- Evaluate target quality using Artemis scoring. See Code Scoring.
- Index your code for better context-aware suggestions. See Code Indexing.