Skip to content

Run checks in threads to speed up execution and analysis  #474

@ericwb

Description

@ericwb

Source blueprint: https://blueprints.launchpad.net/bandit/+spec/use-threading-when-running-checks

Many static analysis tools offer parallelization of execution to make checking large amounts of code faster. Flake8, for example, added the -j flag so that files would be checked in parallel. When running bandit against large amounts of code, e.g., openstack/glance, the checks take quite a while. For over 7500 files, the checks take several minutes.

I propose that we add a similar flag (to -j/--jobs) with similar behaviour to the flag in Flake8.

For example,

$ bandit -j 4 -r glance/

Would use 4 threads, while

$ bandit -j auto -r glance

Would use the number of CPUs present and could be the default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions