I tend to look at cyclomatic complexity[0], in my functions. I use SwiftLint[1] to measure it, and flag functions that are too complex. Sometimes, I sort of kludge, and break the function into parts, but I usually find some way to do things more simply.
My files tend to be fairly long, but I also have a 50/50 comment-to-code ratio.
I'll bet that you could prompt an LLM to both reduce CC, and add lots of comments.
My files tend to be fairly long, but I also have a 50/50 comment-to-code ratio.
I'll bet that you could prompt an LLM to both reduce CC, and add lots of comments.
[0] https://en.wikipedia.org/wiki/Cyclomatic_complexity
[1] https://littlegreenviper.com/swiftlint/