terryyin / lizard

A simple code complexity analyser without caring about the C/C++ header files or Java imports, supports most of the popular languages.
Other
1.85k stars 250 forks source link

A wrong result "if", "for", "synchronized","while" ,not a function #213

Open cyw3 opened 6 years ago

cyw3 commented 6 years ago

lizard scan objc project:

image

Find some wrong result. it is "if" statement, not a function. image

@terryyin

ana28p commented 3 years ago

I also get wrong methods for C#. From what I noticed, it fails to detect property's set and get:

public string Filename
        {
            get
            {
                if (string.IsNullOrEmpty(filename))
                {
                    return "Default";
                }

                return filename;
            }
            set
            {
                filename = value;
            }
        }

, or methods that use specific generics for type: public static T ByteArrayToStructure<T>(byte[] bytes) where T : struct { ... }

It will report the first encapsulated if, for, while, etc..