MaibornWolff / MaibornWolff/codecharta

Unifiedparser: Add the same default excludes that Tokei has

Open
#4,143 0 comments 0 reactions 0 assignees View on GitHub
pr-analysis priority:high
Dominant language
TypeScript
Stars
529
Forks
56
Avg merge
7h 17m
Merged PRs (30d)
34

Description

# Feature request

[Tokei](https://github.com/XAMPPRocky/tokei/tree/master) is a well-established tool that counts lines of code. It is reasonable to assume they have encountered most directories that should be excluded when counting code. Let's exclude what they exclude.

Relates to #4142 and #4121

## Description

As an auditor, I want to exclude the generated/unneeded code, so that I can focus on the relevant code.

I could not find what tokei excludes by default. But I can ask ChatGPT and that does provide a reasonable list:

```
".bzr/",
".cdv/",
".git/",
".hg/",
".pc/",
".svn/",
".tox/",
".idea/",
".vscode/",
"__pycache__/",
"node_modules/",
"target/",
"venv/",
"bower_components/",
"env/",
"build/",
"dist/",
"CVS/",
"RCS/",
"SCCS/",
"_darcs/",
"_build/",
"deps/"
```

The ones I recognize are:

```
# version control
".git/",
".svn/",
# IDE
".idea/",
".vscode/",
# Python
"__pycache__/",
"venv/",
# Node
"node_modules/",
"bower_components/",
"dist/",
# Maven, Cargo
"target/",
# Gradle
"build/",
# Environment stuff, somewhat standardized
"env/",
# unsure, but seems reasonable
"_build/",
"deps/"
```

I propose to add at least the second bottom list, perhaps the full top list after some research what the other folders are for.

## Acceptance criteria
- More sensible directories are exclude by default

## Assumptions & Exclusions
The assumption is that ChatGPT did not include completely random directories. The bottom list is something I have confidence in, because I know the directories. The upper list needs to be vetted.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the unifiedparser entry point and its default directory-exclusion configuration, then compare the current behavior with Tokei's defaults. Research the directories in the proposed lists before selecting the exclusions, and add or update tests to verify that sensible generated, dependency, version-control, and IDE directories are excluded by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.