Open iAnanich opened 6 years ago
I will check that, thanks for reporting.
What's your solution to this problem? How do you think it should be solved?
I don't know it works underhood, but I think that if it's possible to track how many lines such string holds, it would be great to compare average complexity per line with a maximum. Because if an average complexity is bigger than maximum then one or more lines are too complex.
The problem is that tree
(here) understands example above like call of spider.logger.error
method with JoinedStr
entirely on the next line.
And this JoinedStr
remembers only lineno
where it starts and it's values
: Str
and FormattedValue
which has the same lineno
as JoinedStr
.
Simple
f'for {url} error code {code} with message {msg} '
string (which is aprt of multi-line string) scores 20 complexity. Full context:And plugin warns only about second line.
Is it OK?