cohesion
cohesion copied to clipboard
A tool for measuring Python class cohesion.
The cohesion calculation should also be for classes that contain either no methods or only static, class or abstract methods, because the cohesion will be 0 %. This is annoying...
Cohesion calculation should be skipped for abstract methods because the cohesion will return 0 %.
Suppose you have this module: ``` class Data(object): def __init__(self, data): if not isinstance(data, list): raise ValueError('Data: Input arg must be list') self.data = data def get_value_at_start(self): return self.get_value_at_index(0) def...
Tried this project out, but found the checker is flagging up enum, TypedDict, and ABC types, making it very noisy.
[hacking](https://github.com/openstack/hacking) uses codes in the range H101-H904, conflicting with H601 from cohesion, making it impossible to use both.
Currently cohesion uses the default encoding for `open()`: https://github.com/mschwager/cohesion/blob/b9add604c2772b37cbc6b80818f981ff36926f24/cohesion/filesystem.py#L10-L11 This takes the encoding from `locale.getpreferredencoding()`, which on my Windows installation is cp1252. So even though my file is saved in...
Fixes #21
I try to initiate a discussion [Uniting Python's Quality Tools](https://github.com/astral-sh/ruff/discussions/20699) in the hope it helps to increase outreach and visibility of this and similar projects