Skip to content

C++ metrics are still calculated for lambdas #813

Description

@barnabasdomozi

In the database we still see C++ metrics calculated for lambdas despite --cppmetrics-ignore-lambdas flag is used.

Example snippet:

#include <iostream>
#include <functional>

void foo(std::function<void()> f) {
  f();
}

int main()
{
  foo([&] () { // <---- Type 2 and 4 metric still calculated for this line
    std::cout << "hello world!\n";
  });
}
  • Type 2: MCCABE_FUNCTION
  • Type 4: BUMPY_ROAD

Goal: add an option to NOT calculate metrics for anonymous classes or compiler generated types.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions