eunomia-bpf / eunomia-bpf

Function with cyclomatic complexity higher than threshold RS-R1000
Anti-pattern
Minor
6 months ago6 months old
fn call has a cyclomatic complexity of 79 with "critical" risk
141        self.api_impl.poll_ready(cx)
142    }
143
144    fn call(&mut self, req: (Request<Body>, C)) -> Self::Future {145        async fn run<T, C>(
146            mut api_impl: T,
147            req: (Request<Body>, C),
fn load_section_data_with_skel_value has a cyclomatic complexity of 31 with "very-high" risk
 43        vec}
 44    };
 45}
 46pub(crate) fn load_section_data_with_skel_value( 47    btf: &Btf,
 48    section: &DataSectionMeta,
 49    buffer: &mut [u8],
fn load_and_attach has a cyclomatic complexity of 27 with "very-high" risk
 52    /// load and attach the ebpf program to the kernel to run the ebpf program
 53    /// if the ebpf program has maps to export to user space, you need to call
 54    /// the wait and export.
 55    pub fn load_and_attach(mut self) -> Result<BpfSkeleton> { 56        // This function differs from the C++ version `int bpf_skeleton::load_and_attach_prog(void)`
 57        // Because we put the call to bpf_object_open in `BpfSkeletonBuilder::build`
 58        // So Here are just the calls to load and attach
fn wait_and_poll_to_handler_with_multiple_exporter has a cyclomatic complexity of 27 with "very-high" risk
211    }
212    /// Start poll with each map corresponding to a different exporter
213    /// The function `exporter_provider` should return the ExportFormatType, EventHandler, and UserContext(if applies) for the given map name (If you want to set the exporter)
214    pub fn wait_and_poll_to_handler_with_multiple_exporter(215        &self,
216        exporter_provider: impl Fn(
217            &str,