From f021e91992ff9a5d21a631a5438a85795ed729be Mon Sep 17 00:00:00 2001 From: Cao Chuan Date: Wed, 8 Mar 2023 17:30:51 +0800 Subject: [PATCH] Fix code scan cyclomatic complexity Signed-off-by: Cao Chuan --- .../main/cpp/napi/image_receiver_mdk_test.cpp | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp/napi/image_receiver_mdk_test.cpp b/multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp/napi/image_receiver_mdk_test.cpp index 0d2971cbf..ea42ed7a7 100644 --- a/multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp/napi/image_receiver_mdk_test.cpp +++ b/multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp/napi/image_receiver_mdk_test.cpp @@ -37,21 +37,20 @@ namespace Media { uint32_t ImageReceiverNDKTest::sOnEvnentCount = 0; napi_value ImageReceiverNDKTest::Init(napi_env env, napi_value exports) { - napi_property_descriptor props[] = { - STATIC_FUNCTION("createImageReceiver",JsCreateImageReceiver), - STATIC_FUNCTION("getReceivingSurfaceId",JsGetReceivingSurfaceId), - STATIC_FUNCTION("readLatestImage",JsReadLatestImage), - STATIC_FUNCTION("readNextImage",JsReadNextImage), - STATIC_FUNCTION("on",JsOn), - STATIC_FUNCTION("getSize",JsGetSize), - STATIC_FUNCTION("getCapacity",JsGetCapacity), - STATIC_FUNCTION("getFormat",JsGetFormat), - STATIC_FUNCTION("getOnEventCount",JsGetOnEventCount), - STATIC_FUNCTION("imageClipRect",JsImageClipRect), - STATIC_FUNCTION("imageSize",JsImageSize), - STATIC_FUNCTION("imageFormat",JsImageFormat), - STATIC_FUNCTION("imageGetComponent",JsImageGetComponent), + STATIC_FUNCTION("createImageReceiver", JsCreateImageReceiver), + STATIC_FUNCTION("getReceivingSurfaceId", JsGetReceivingSurfaceId), + STATIC_FUNCTION("readLatestImage", JsReadLatestImage), + STATIC_FUNCTION("readNextImage", JsReadNextImage), + STATIC_FUNCTION("on", JsOn), + STATIC_FUNCTION("getSize", JsGetSize), + STATIC_FUNCTION("getCapacity", JsGetCapacity), + STATIC_FUNCTION("getFormat", JsGetFormat), + STATIC_FUNCTION("getOnEventCount", JsGetOnEventCount), + STATIC_FUNCTION("imageClipRect", JsImageClipRect), + STATIC_FUNCTION("imageSize", JsImageSize), + STATIC_FUNCTION("imageFormat", JsImageFormat), + STATIC_FUNCTION("imageGetComponent", JsImageGetComponent), }; napi_define_properties(env, exports, sizeof(props) / sizeof(props[0]), props); return exports; @@ -219,7 +218,6 @@ napi_value ImageReceiverNDKTest::JsGetSize(napi_env env, napi_callback_info info setInt32NamedProperty(env, result, "width", size.width); setInt32NamedProperty(env, result, "height", size.height); return result; - } napi_value ImageReceiverNDKTest::JsGetCapacity(napi_env env, napi_callback_info info) -- GitLab