Open ResistantBear opened 4 months ago
I put it to state "new issue" since we need to prepare/refine the issue.
Method references seem to be the Java-concept for passing a function by value. As that does not involve implementing a new function (at least not from the view of the programmer), we should not count them as new function definition.
Originally posted by @ResistantBear in https://github.com/MaibornWolff/metric-gardener/issues/94#issuecomment-1934219476
There are still points of disussion left, including:
goto
.#if
,#ifdef
or#ifndef
, which are covered by the two syntax node types "preproc_if" and "preproc_ifdef". As they are only evaluated at compile time, we might continue to not count them.case "a" or "b"
, which is supported by some languages, or not. As far as I know, we do count that in languages where this OR is handled by one of the Syntax Nodes which are also used for OR on other places like C#, but not for Rust, Python or Ruby. If we try to be consistent to what is done for regular OR and AND expressions, we should also count that. However, either way, we probably require more special handling again to make this consistent across programming languages.when
case guards in switch labels (C#).forEach
or.catch
in JS/TS orforEach
andmap
from Java Streams. Note that a user could also build his ownforeach
function using recursion, etc., and we are unable to check for such a thing.