Exclude/ignore certain directories or single files from the analysis
By default DeepCode's cli or IDE plugins respect the existing ".gitignore". Which means that if your ".gitignore" ignores the "node_modules" directory (for node projects), this directory will not be uploaded to DeepCode for analysis.
In most cases the default ".gitignore" should be sufficient for your purposes, however if you have a case not covered by using the default ".gitignore", using DeepCode's ".dcignore" is the way to go. These cases might include when you don't have a ".gitignore" or when you want a file or a directory being analysed by DeepCode, but ignored by git.
Add file ".dcignore"
You can easily exclude directories or single files from being analysed. This includes, but is not limited to:
- project dependencies
- mocks and/or tests.
This can be easily achieved by adding a special file called ".dcignore" in any of the analysed project's sub-folders. This file supports glob syntax with "*" and "**" to specify file masks and sub-folders. You may create multiple .dcignore files in different sub-folders as you wish.
- In the directory where you want to ignore files, you should create/have a file named ".dcignore".
- In this file: you can list which files should be ignored: e.g. "directory/**" will ignore all files in "directory." Here is how our ".dcignore" looks like when we are using DeepCode's VS Code plugin:
dc_server/**/*_test.js dc_server/migrations dc_client/**/*_test.js
Disable two issues for the same line
The DeepCode engine respects the following notation:
// deepcode ignore CompareTypeofToString,reDOS: <another comment the reason here>
CompareTypeofToString and reDOS are the suggestion ids.
Still need some help?
- feel free to contact us if you still need help here.
- if you still haven't downloaded our IDE extensions, you can do so here: