You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The common guard statement is not handled. This is equivalent to an up-front test in C++ such as if (blah == nullptr) return;
A less-important addition would be to add defer which is equivalent to using the C++ RAII idiom but is simpler, with a statement rather than needing a helper class.
To Reproduce
I reviewed languages.json and noticed guard is missing.
Expected behavior
Count guard to add to complexity. It's a very common part of control flow in many Swift functions. It is often the only branch expression in a function.
Also suggest adding defer which is less common but can't see a reason not to add it as it's a reserved word.
Desktop:
OS: macOS
Version 3.4.0
The text was updated successfully, but these errors were encountered:
I do not think defer should be counted because defer does not generate any branch:
The document says "always runs", so no conditions here.
I'll try to add guard, it actually generates branches. ? and catch should be counted too. AFAIK other complexity counting tools like lizard also count them.
Describe the bug
The common guard statement is not handled. This is equivalent to an up-front test in C++ such as
if (blah == nullptr) return;
A less-important addition would be to add defer which is equivalent to using the C++ RAII idiom but is simpler, with a statement rather than needing a helper class.
To Reproduce
I reviewed
languages.json
and noticedguard
is missing.Expected behavior
Count
guard
to add to complexity. It's a very common part of control flow in many Swift functions. It is often the only branch expression in a function.Also suggest adding
defer
which is less common but can't see a reason not to add it as it's a reserved word.Desktop:
The text was updated successfully, but these errors were encountered: