The following issues were found

modules/photo/misc/java/test/PhotoTest.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: 12

              
public class PhotoTest extends OpenCVTestCase {

    public void testInpaint() {
        Point p = new Point(matSize / 2, matSize / 2);
        Imgproc.circle(gray255, p, 2, colorBlack, Imgproc.FILLED);
        Imgproc.circle(gray0,   p, 2, colorWhite, Imgproc.FILLED);

        Photo.inpaint(gray255, gray0, dst, 3, Photo.INPAINT_TELEA);

            

Reported by PMD.

Avoid unused imports such as 'org.opencv.core.Core'
Design

Line: 3

              package org.opencv.test.photo;

import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Point;
import org.opencv.photo.Photo;
import org.opencv.test.OpenCVTestCase;
import org.opencv.imgproc.Imgproc;


            

Reported by PMD.

modules/video/perf/perf_disflow.cpp
1 issues
syntax error
Error

Line: 13

              typedef tuple<String, Size> DISParams;
typedef TestBaseWithParam<DISParams> DenseOpticalFlow_DIS;

PERF_TEST_P(DenseOpticalFlow_DIS, perf,
            Combine(Values("PRESET_ULTRAFAST", "PRESET_FAST", "PRESET_MEDIUM"), Values(szVGA, sz720p, sz1080p)))
{
    DISParams params = GetParam();

    // use strings to print preset names in the perf test results:

            

Reported by Cppcheck.

3rdparty/libjpeg-turbo/src/jdmarker.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If MAKESTMT is a macro then please configure it.
Error

Line: 251

                cinfo->progressive_mode = is_prog;
  cinfo->arith_code = is_arith;

  INPUT_2BYTES(cinfo, length, return FALSE);

  INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);
  INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE);
  INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE);
  INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);

            

Reported by Cppcheck.

3rdparty/libjpeg-turbo/src/jstdhuff.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If LOCAL is a macro then please configure it.
Error

Line: 19

               * Huffman table setup routines
 */

LOCAL(void)
add_huff_table(j_common_ptr cinfo, JHUFF_TBL **htblptr, const UINT8 *bits,
               const UINT8 *val)
/* Define a Huffman table */
{
  int nsymbols, len;

            

Reported by Cppcheck.

3rdparty/libjpeg/jdmarker.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If MAKESTMT is a macro then please configure it.
Error

Line: 253

                cinfo->progressive_mode = is_prog;
  cinfo->arith_code = is_arith;

  INPUT_2BYTES(cinfo, length, return FALSE);

  INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);
  INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE);
  INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE);
  INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);

            

Reported by Cppcheck.

3rdparty/libwebp/src/dsp/lossless.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If GENERATE_PREDICTOR_ADD is a macro then please configure it.
Error

Line: 185

                  out[i] = left = VP8LAddPixels(in[i], left);
  }
}
GENERATE_PREDICTOR_ADD(VP8LPredictor2_C, PredictorAdd2_C)
GENERATE_PREDICTOR_ADD(VP8LPredictor3_C, PredictorAdd3_C)
GENERATE_PREDICTOR_ADD(VP8LPredictor4_C, PredictorAdd4_C)
GENERATE_PREDICTOR_ADD(VP8LPredictor5_C, PredictorAdd5_C)
GENERATE_PREDICTOR_ADD(VP8LPredictor6_C, PredictorAdd6_C)
GENERATE_PREDICTOR_ADD(VP8LPredictor7_C, PredictorAdd7_C)

            

Reported by Cppcheck.

3rdparty/libwebp/src/dsp/lossless_sse2.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If GENERATE_PREDICTOR_ADD is a macro then please configure it.
Error

Line: 252

              
// Due to averages with integers, values cannot be accumulated in parallel for
// predictors 5 to 7.
GENERATE_PREDICTOR_ADD(Predictor5_SSE2, PredictorAdd5_SSE2)
GENERATE_PREDICTOR_ADD(Predictor6_SSE2, PredictorAdd6_SSE2)
GENERATE_PREDICTOR_ADD(Predictor7_SSE2, PredictorAdd7_SSE2)

#define GENERATE_PREDICTOR_2(X, IN)                                           \
static void PredictorAdd##X##_SSE2(const uint32_t* in, const uint32_t* upper, \

            

Reported by Cppcheck.

3rdparty/protobuf/src/google/protobuf/io/coded_stream.cc
1 issues
syntax error
Error

Line: 124

                // security: byte_limit is possibly evil, so check for negative values
  // and overflow. Also check that the new requested limit is before the
  // previous limit; otherwise we continue to enforce the previous limit.
  if GOOGLE_PREDICT_TRUE(byte_limit >= 0 &&
                  byte_limit <= INT_MAX - current_position &&
                  byte_limit < current_limit_ - current_position) {
    current_limit_ = current_position + byte_limit;
    RecomputeBufferLimits();
  }

            

Reported by Cppcheck.

3rdparty/protobuf/src/google/protobuf/util/message_differencer.cc
1 issues
Uninitialized variable: differencer
Error

Line: 184 CWE codes: 908

                                              const Message& message2) {
  MessageDifferencer differencer;

  return differencer.Compare(message1, message2);
}

bool MessageDifferencer::Equivalent(const Message& message1,
                                    const Message& message2) {
  MessageDifferencer differencer;

            

Reported by Cppcheck.

modules/calib3d/perf/perf_affine2d.cpp
1 issues
There is an unknown macro here somewhere. Configuration is required. If CV_ENUM is a macro then please configure it.
Error

Line: 50

              {
using namespace perf;

CV_ENUM(Method, RANSAC, LMEDS)
typedef tuple<int, double, Method, size_t> AffineParams;
typedef TestBaseWithParam<AffineParams> EstimateAffine;
#define ESTIMATE_PARAMS Combine(Values(100000, 5000, 100), Values(0.99, 0.95, 0.9), Method::all(), Values(10, 0))

static float rngIn(float from, float to) { return from + (to-from) * (float)theRNG(); }

            

Reported by Cppcheck.