Analyzed Files

By default, Scrutinizer will inspect all files in your project directory. This might include files which you installed (f.e. dependencies) or files that you do not want to analyze (f.e. tests).

Configuration

You can fine tune the analyzed files using the filter configuration:

filter:
    paths: ["dir1/*", "dir2/*"]
    excluded_paths:
        - "tests/"               # Everything in a root level "tests" directory
        - "tests"                # Without trailing "/", just ignores a single file name "tests"
                                 # in your root folder

        - "src/*Bundle/Tests/"   # Wildcards can be placed anywhere
        - "*/Tests/*"            # Everything that has a "Tests" directory somewhere in the path

    dependency_paths:
        - vendor/

In general, the more specific pattern in one of the three entries (paths, excluded_paths, or dependency_paths) wins and determines how a file is treated. A longer pattern is considered more specific and overrides a shorter pattern.

Dependency Paths vs. Excluded Paths

More sophisticated analysis tools also look at the dependencies of your project to better reason about your project. For these tools, the dependency_paths setting above signals that the tool should look at files in these directories to index the classes or functions defined there, but it should not analyze those files for issues.

For simple analysis tools, the dependency_paths setting behaves like the excluded_paths setting.

Example

This approach allows you to mix whitelist and blacklist approaches as it makes sense for the structure of your project. Here is an example configuration:

filter:
    paths:
        - src/

    dependency_paths:
        - src/Foo/

    excluded_paths:
        - src/Foo/Tests/

With the above configuration, we generally analyze only files in the src/, but files in the src/Foo/ sub-folder are only indexed and not inspected for issues, and files in the sub-path src/Foo/Tests/ are not looked at, at all.