complexipy icon indicating copy to clipboard operation
complexipy copied to clipboard

Ignore files and directories

Open juansedo opened this issue 11 months ago • 2 comments

As a user, I want a way to ignore files and directories from the cognitive complexity analysis to exclude some custom fixes for libraries.

Issue can be solved using a filter before scanning the complexity (https://github.com/rohaquinlop/complexipy/blob/main/src/cognitive_complexity/mod.rs#L150-L160).

Ignored files and directories can be discovered with:

  • CLI approach with --ignore-paths= flag.
  • Read a file like a .gitignore to ignore paths.

juansedo avatar Jan 13 '25 14:01 juansedo

Hey @juansedo I think that the .gitignore file is already being considered during the execution, isn't it working?

rohaquinlop avatar Jan 15 '25 16:01 rohaquinlop

Sorry for the delay! Yes, but I want to exclude files from complexipy without excluding them from version control.

juansedo avatar Mar 26 '25 19:03 juansedo

Same for us. We have bunch of autogenerated code based on openapi specs e.g. for schema validation and we have it under version control but we would like to exclude it from complexipy results.

maciejstromich avatar Sep 16 '25 17:09 maciejstromich