The following issues were found

modules/dnn/src/layers/region_layer.cpp
2 issues
Iterators of different containers are used together.
Error

Line: 564 CWE codes: 664

              
            for (int i = 1; i < w; i++)
            {
                std::copy(bias_w.begin(), bias_w.begin() + h * anchors, bias_w.begin() + i * h * anchors);
                std::copy(bias_h.begin(), bias_h.begin() + h * anchors, bias_h.begin() + i * h * anchors);
            }

            box_w = std::make_shared<ngraph::op::v0::Exp>(split->output(2));
            box_w = std::make_shared<ngraph::op::v1::Reshape>(box_w, shape_3d, true);

            

Reported by Cppcheck.

Iterators of different containers are used together.
Error

Line: 565 CWE codes: 664

                          for (int i = 1; i < w; i++)
            {
                std::copy(bias_w.begin(), bias_w.begin() + h * anchors, bias_w.begin() + i * h * anchors);
                std::copy(bias_h.begin(), bias_h.begin() + h * anchors, bias_h.begin() + i * h * anchors);
            }

            box_w = std::make_shared<ngraph::op::v0::Exp>(split->output(2));
            box_w = std::make_shared<ngraph::op::v1::Reshape>(box_w, shape_3d, true);
            auto anchor_w_node = std::make_shared<ngraph::op::Constant>(ngraph::element::f32, box_broad_shape, bias_w.data());

            

Reported by Cppcheck.

modules/features2d/test/ocl/test_brute_force_matcher.cpp
2 issues
syntax error
Error

Line: 115

              };

#ifdef __ANDROID__
OCL_TEST_P(BruteForceMatcher, DISABLED_Match_Single)
#else
OCL_TEST_P(BruteForceMatcher, Match_Single)
#endif
{
    BFMatcher matcher(distType);

            

Reported by Cppcheck.

syntax error
Error

Line: 117

              #ifdef __ANDROID__
OCL_TEST_P(BruteForceMatcher, DISABLED_Match_Single)
#else
OCL_TEST_P(BruteForceMatcher, Match_Single)
#endif
{
    BFMatcher matcher(distType);

    std::vector<cv::DMatch> matches;

            

Reported by Cppcheck.

modules/objdetect/misc/java/test/ObjdetectTest.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 7

              
public class ObjdetectTest extends OpenCVTestCase {

    public void testGroupRectanglesListOfRectListOfIntegerInt() {
        fail("Not yet implemented");
        /*
        final int NUM = 10;
        MatOfRect rects = new MatOfRect();
        rects.alloc(NUM);

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 23

                      */
    }

    public void testGroupRectanglesListOfRectListOfIntegerIntDouble() {
        fail("Not yet implemented");
        /*
        final int NUM = 10;
        MatOfRect rects = new MatOfRect();
        rects.alloc(NUM);

            

Reported by PMD.

samples/python/tutorial_code/imgProc/hough_line_transform/probabilistic_hough_line_transform.py
2 issues
Unable to import 'cv2'
Error

Line: 1 Column: 1

              import cv2 as cv
import numpy as np

img = cv.imread(cv.samples.findFile('sudoku.png'))
gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY)
edges = cv.Canny(gray,50,150,apertureSize = 3)
lines = cv.HoughLinesP(edges,1,np.pi/180,100,minLineLength=100,maxLineGap=10)
for line in lines:
    x1,y1,x2,y2 = line[0]

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import cv2 as cv
import numpy as np

img = cv.imread(cv.samples.findFile('sudoku.png'))
gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY)
edges = cv.Canny(gray,50,150,apertureSize = 3)
lines = cv.HoughLinesP(edges,1,np.pi/180,100,minLineLength=100,maxLineGap=10)
for line in lines:
    x1,y1,x2,y2 = line[0]

            

Reported by Pylint.

modules/features2d/perf/perf_feature2d.hpp
2 issues
There is an unknown macro here somewhere. Configuration is required. If CV_ENUM is a macro then please configure it.
Error

Line: 30

              #define CV_ENUM_EXPAND(name, ...) CV_ENUM(name, __VA_ARGS__)

enum Feature2DVals { DETECTORS_ONLY, DETECTORS_EXTRACTORS };
CV_ENUM_EXPAND(Feature2DType, DETECTORS_ONLY, DETECTORS_EXTRACTORS)

typedef tuple<Feature2DType, string> Feature2DType_String_t;
typedef perf::TestBaseWithParam<Feature2DType_String_t> feature2d;

#define TEST_IMAGES testing::Values(\

            

Reported by Cppcheck.

There is an unknown macro here somewhere. Configuration is required. If CV_ENUM is a macro then please configure it.
Error

Line: 30

              #define CV_ENUM_EXPAND(name, ...) CV_ENUM(name, __VA_ARGS__)

enum Feature2DVals { DETECTORS_ONLY, DETECTORS_EXTRACTORS };
CV_ENUM_EXPAND(Feature2DType, DETECTORS_ONLY, DETECTORS_EXTRACTORS)

typedef tuple<Feature2DType, string> Feature2DType_String_t;
typedef perf::TestBaseWithParam<Feature2DType_String_t> feature2d;

#define TEST_IMAGES testing::Values(\

            

Reported by Cppcheck.

modules/calib3d/perf/perf_stereosgbm.cpp
2 issues
syntax error
Error

Line: 51

              typedef TestBaseWithParam<SGBMParams> TestStereoCorrespSGBM;

#ifndef _DEBUG
PERF_TEST_P( TestStereoCorrespSGBM, SGBM, Combine(Values(Size(1280,720),Size(640,480)), Values(256,128), SGBMModes::all()) )
#else
PERF_TEST_P( TestStereoCorrespSGBM, DISABLED_TooLongInDebug_SGBM, Combine(Values(Size(1280,720),Size(640,480)), Values(256,128), SGBMModes::all()) )
#endif
{
    SGBMParams params = GetParam();

            

Reported by Cppcheck.

syntax error
Error

Line: 53

              #ifndef _DEBUG
PERF_TEST_P( TestStereoCorrespSGBM, SGBM, Combine(Values(Size(1280,720),Size(640,480)), Values(256,128), SGBMModes::all()) )
#else
PERF_TEST_P( TestStereoCorrespSGBM, DISABLED_TooLongInDebug_SGBM, Combine(Values(Size(1280,720),Size(640,480)), Values(256,128), SGBMModes::all()) )
#endif
{
    SGBMParams params = GetParam();

    Size sz              = get<0>(params);

            

Reported by Cppcheck.

3rdparty/openexr/Imath/ImathColor.h
2 issues
The address of local variable 'r' might be accessed at non-zero index.
Error

Line: 448 CWE codes: 758

              inline T &
Color4<T>::operator [] (int i)
{
    return (&r)[i];
}

template <class T>
inline const T &
Color4<T>::operator [] (int i) const

            

Reported by Cppcheck.

The address of local variable 'r' might be accessed at non-zero index.
Error

Line: 455 CWE codes: 758

              inline const T &
Color4<T>::operator [] (int i) const
{
    return (&r)[i];
}

template <class T>
inline
Color4<T>::Color4 ()

            

Reported by Cppcheck.

modules/gapi/test/common/gapi_tests_common.hpp
2 issues
failed to expand 'GAPI_TEST_FIXTURE', Wrong number of parameters for macro '__WRAP_VAARGS'.
Error

Line: 546

               *                  must be empty.
 */
 //TODO: Consider to remove `Number` and use `std::tuple_size<decltype(std::make_tuple(__VA_ARGS__))>::value`
#define GAPI_TEST_FIXTURE(Fixture, InitF, API, Number, ...) \
    struct Fixture : public TestWithParams API { \
        static_assert(Number == AllParams::specific_params_size, \
            "Number of user-defined parameters doesn't match size of __VA_ARGS__"); \
        __WRAP_VAARGS(DEFINE_SPECIFIC_PARAMS_##Number(__VA_ARGS__)) \
        Fixture() { InitF(type, sz, dtype); } \

            

Reported by Cppcheck.

failed to expand 'GAPI_TEST_FIXTURE_SPEC_PARAMS', Wrong number of parameters for macro '__WRAP_VAARGS'.
Error

Line: 588

               * @param ...       list of names of user-defined parameters. if there are no parameters, the list
 *                  must be empty.
 */
#define GAPI_TEST_FIXTURE_SPEC_PARAMS(Fixture, API, Number, ...) \
    struct Fixture : public TestWithParamsSpecific API { \
        static_assert(Number == AllParams::specific_params_size, \
            "Number of user-defined parameters doesn't match size of __VA_ARGS__"); \
        __WRAP_VAARGS(DEFINE_SPECIFIC_PARAMS_##Number(__VA_ARGS__)) \
    };

            

Reported by Cppcheck.

modules/dnn/test/test_darknet_importer.cpp
2 issues
syntax error
Error

Line: 488

                  }
}

INSTANTIATE_TEST_CASE_P(/**/, Test_Darknet_nets_async, Combine(
    Values("yolo-voc", "tiny-yolo-voc", "yolov3", "yolov4", "yolov4-tiny"),
    dnnBackendsAndTargets()
));

#endif

            

Reported by Cppcheck.

syntax error
Error

Line: 718

              }


INSTANTIATE_TEST_CASE_P(/**/, Test_Darknet_nets, dnnBackendsAndTargets());

TEST_P(Test_Darknet_layers, shortcut)
{
    testDarknetLayer("shortcut");
    testDarknetLayer("shortcut_leaky");

            

Reported by Cppcheck.

modules/objdetect/test/test_qrcode.cpp
2 issues
syntax error
Error

Line: 34

              //#define UPDATE_QRCODE_TEST_DATA
#ifdef  UPDATE_QRCODE_TEST_DATA

TEST(Objdetect_QRCode, generate_test_data)
{
    const std::string root = "qrcode/";
    const std::string dataset_config = findDataFile(root + "dataset_config.json");
    FileStorage file_config(dataset_config, FileStorage::WRITE);


            

Reported by Cppcheck.

syntax error
Error

Line: 583

                  }
}

INSTANTIATE_TEST_CASE_P(/**/, Objdetect_QRCode, testing::ValuesIn(qrcode_images_name));
INSTANTIATE_TEST_CASE_P(/**/, Objdetect_QRCode_Close, testing::ValuesIn(qrcode_images_close));
INSTANTIATE_TEST_CASE_P(/**/, Objdetect_QRCode_Monitor, testing::ValuesIn(qrcode_images_monitor));
INSTANTIATE_TEST_CASE_P(/**/, Objdetect_QRCode_Curved, testing::ValuesIn(qrcode_images_curved));
INSTANTIATE_TEST_CASE_P(/**/, Objdetect_QRCode_Multi, testing::ValuesIn(qrcode_images_multiple));


            

Reported by Cppcheck.