insightsengineering / insightsengineering/teal.code

[Feature Request]: High cyclomatic complexity leds to bad readability

Open
#295 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
R
Stars
12
Forks
11
Avg merge
1d 17h
Merged PRs (30d)
1

Description

### Feature description

There are some functions that are highly complex and hard to read:

```
name cyclocomp
13 extract_occurrence 30
12 extract_dependency 13
33 move_functions_after_arrow 10
30 lang2calls 7
5 c.qenv 6
17 fix_shifted_comments 6
```

It would be good to make it easier to read the `extract_dependency` and `extract_occurrence` so that it is easier to modify them and fix any error.

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct.

### Contribution Guidelines

- [x] I agree to follow this project's Contribution Guidelines.

### Security Policy

- [x] I agree to follow this project's Security Policy.

Contributor guide

Open the contributing guide

Research direction

Find the R implementations and callers of extract_dependency and extract_occurrence, then read any existing tests around them. Refactor the functions to improve readability and reduce cyclomatic complexity while preserving their current behavior; verify the repository's existing checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.