Comment

Comment by aappleby

The article is somewhat silly, but there's a kernel of good advice here -

To estimate the "complexity" of a codebase:

1. Remove all comments

2. Replace all spans of whitespace with a single space

3. Concatenate all source together into a single file

4. Compress the resulting text file using gzip -9 (or your favorite compression engine)

The size of the resulting file is a good proxy for overall complexity. It's not heavily affected by naming conventions, and a refactoring that reduces the number is probably good for overall complexity.

It's not a perfect metric as it doesn't include any notion of cyclomatic complexity, but it's a good start and useful to track over time.

parent aappleby 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton