Scanyp delivers a wide range of intriguing metrics. However, developers often struggle to interpret the meaning of these metrics in order to make informed decisions about potential improvements.
To address this, Scanyp has introduced a feature called 'labels' that translates these metrics into more easily understandable terms.
Such labels include descriptors like "Not Complex", "Too Big", "Too Highly Coupled", and "Few Issues". With these labels, determining the quality of a codebase becomes much simpler.
Scanyp comes preloaded with a set of interesting labels, but there's also flexibility for users to generate their own labels via the Labels tab.
Labels are defined by Python functions known as 'label functions'. Here is an example of what a label function might look like:
def labelfunction(application): PassLabel="Not Complex" WarnLabel="Complex" FailLabel="Too Complex" PassElements= [ m for m in application.Methods if m.CyclomaticComplexity<=20] WarnElements= [ m for m in application.Methods if m.CyclomaticComplexity>20 and m.CyclomaticComplexity<=30] FailElements=[ m for m in application.Methods if m.CyclomaticComplexity>30] return PassLabel,WarnLabel,FailLabel,PassElements,WarnElements,FailElements