clutcher / bh

Issue tracker for Better Highlights Intellij IDEA plugin
7 stars 0 forks source link

Cognitive complexity statistics are incomprehensibly high in ESP IDF project #147

Open bcdax110 opened 14 hours ago

bcdax110 commented 14 hours ago

ESP IDF Hello World project as follow:

_Noreturn void app_main(void)
{
    while(1){
        ESP_LOGI("Test", "Hello World");
    }
}

The complexity statistics for the function _Noreturn void app_main(void) is 19 (126%).

clutcher commented 11 hours ago

@bcdax110 Can you provide more information? What IDE? What language? How can I setup it to reproduce? etc.

bcdax110 commented 11 hours ago

IDE

CLion IDE and plugin ESP-IDF

Language

C

Steps to Reproduce:

  1. Install ESP-IDF from https://dl.espressif.com/dl/esp-idf/.

  2. In CLion, create a new project with the following settings:
    Clip_2024-10-14_19-30-15

    • Env Type: ESP-IDF
    • Install Path: <path to ESP-IDF install path>/frameworks/esp-idf-v5.3.1
  3. Add the following code to the void app_main(void) function in the file main/<project_name>.c:

    while(1) {
        ESP_LOGI("Test", "Hello World");
    }
  4. "high complexity (126%)" will appear above the app_main function.
    Clip_2024-10-14_19-37-11