Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

functions in cssutils/css/selector.py are too complex #47

Closed
jaraco opened this issue Mar 30, 2024 · 2 comments
Closed

functions in cssutils/css/selector.py are too complex #47

jaraco opened this issue Mar 30, 2024 · 2 comments

Comments

@jaraco
Copy link
Owner

jaraco commented Mar 30, 2024

The code in selector.py is too complex, with lots of closures and entangled concerns.

 cssutils main @ pip-run mccabe -- -m mccabe cssutils/css/selector.py -m 10
202:4: 'Selector._setSelectorText' 88
@jaraco jaraco changed the title append function in selector is too complex (15 > 10) functions in cssutils/css/selector.py are too complex May 14, 2024
@jaraco
Copy link
Owner Author

jaraco commented May 14, 2024

The module is much better now, with just three functions having complexity over 10:

 cssutils main @ pip-run mccabe -- -m mccabe cssutils/css/selector.py -m 10
66:4: 'New.append' 15
365:4: 'New._char' 13
765:4: 'Selector._prepare_tokens' 13

@jaraco
Copy link
Owner Author

jaraco commented Jun 4, 2024

I'm declaring this work good enough for now. It'd be nice to reduce the complexity more, but not enough to track in an issue.

@jaraco jaraco closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant