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

Lizard Skips Odd function Declarations #353

Open
MichaelBMiner opened this issue Apr 27, 2022 · 0 comments
Open

Lizard Skips Odd function Declarations #353

MichaelBMiner opened this issue Apr 27, 2022 · 0 comments

Comments

@MichaelBMiner
Copy link

I have a Jenkins pipeline which builds my application then runs various tools. Doxygen, CppCheck, Lizard Code complexity and a few others. In my code many functions are declared as static, this meads my unit tests (ceedling) cannot see them, or test them.

To make them visible for ceedling I have to declare each function as follows

#ifdef CEEDLING_TESTS
uint16_t ring_buffer_advance(uint16_t current_index, uint16_t buffer_size){
#else
static uint16_t ring_buffer_advance(uint16_t current_index, uint16_t buffer_size){
#endif
	if (buffer_size > 0) {
		current_index++;
		if (current_index >= buffer_size) {
			current_index = 0;
		}
	} else {
		printf("error - ring buffer max value can not be zero \n");
		current_index = 0;
	}

	return current_index;
}

Now in the c and h files I use ifdefs to create the appropriate function prototype. Lizard does not find these functions and does not generate a complexity report.

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