Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda expressions let extension fail #2

Open
Meerownymous opened this issue Jun 19, 2017 · 0 comments
Open

Lambda expressions let extension fail #2

Meerownymous opened this issue Jun 19, 2017 · 0 comments

Comments

@Meerownymous
Copy link

If a class is using a lambda expression for a function, the analysis fails.
The class does not show the complexity numbers near the code.

Example:

    public class SpecProgram : Program
    {
        private readonly Program _program;
        private readonly Dialect _dialect;

        public SpecProgram(Program program) : this(program, new SpecDialect())
        { }

        public SpecProgram(Program program, Dialect dialect)
        {
            _program = program;
            _dialect = dialect;
        }

        public string Key() => _program.Key(); //This leads to failure, removing it makes the analysis work

        public ICollection<Command> Commands()
        {
            return _program.Commands()
                .Select(c => 
                    new SpecCommand(c, _dialect)
                ).ToList<Command>();
        }

        public ICollection<Instruction> Parameters()
        {
            return _program.Parameters();
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant