The following issues were found

platforms/winpack_dldt/2020.3.0/patch.config.py
5 issues
Undefined variable 'applyPatch'
Error

Line: 1 Column: 1

              applyPatch('20200413-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-fix-binaries-location.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200604-dldt-disable-multidevice.patch')

            

Reported by Pylint.

Undefined variable 'applyPatch'
Error

Line: 2 Column: 1

              applyPatch('20200413-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-fix-binaries-location.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200604-dldt-disable-multidevice.patch')

            

Reported by Pylint.

Undefined variable 'applyPatch'
Error

Line: 3 Column: 1

              applyPatch('20200413-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-fix-binaries-location.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200604-dldt-disable-multidevice.patch')

            

Reported by Pylint.

Undefined variable 'applyPatch'
Error

Line: 4 Column: 1

              applyPatch('20200413-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-fix-binaries-location.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200604-dldt-disable-multidevice.patch')

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              applyPatch('20200413-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-fix-binaries-location.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200604-dldt-disable-multidevice.patch')

            

Reported by Pylint.

platforms/winpack_dldt/2020.2/patch.config.py
5 issues
Undefined variable 'applyPatch'
Error

Line: 1 Column: 1

              applyPatch('20200413-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-fix-binaries-location.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200415-ngraph-disable-unused-options.patch')

            

Reported by Pylint.

Undefined variable 'applyPatch'
Error

Line: 2 Column: 1

              applyPatch('20200413-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-fix-binaries-location.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200415-ngraph-disable-unused-options.patch')

            

Reported by Pylint.

Undefined variable 'applyPatch'
Error

Line: 3 Column: 1

              applyPatch('20200413-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-fix-binaries-location.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200415-ngraph-disable-unused-options.patch')

            

Reported by Pylint.

Undefined variable 'applyPatch'
Error

Line: 4 Column: 1

              applyPatch('20200413-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-fix-binaries-location.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200415-ngraph-disable-unused-options.patch')

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              applyPatch('20200413-dldt-disable-unused-targets.patch')
applyPatch('20200413-dldt-fix-binaries-location.patch')
applyPatch('20200413-dldt-pdb.patch')
applyPatch('20200415-ngraph-disable-unused-options.patch')

            

Reported by Pylint.

platforms/android/ndk-18.config.py
5 issues
Undefined variable 'ABI'
Error

Line: 2 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None),
    ABI("5", "x86_64",      None),
    ABI("4", "x86",         None),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 3 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None),
    ABI("5", "x86_64",      None),
    ABI("4", "x86",         None),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 4 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None),
    ABI("5", "x86_64",      None),
    ABI("4", "x86",         None),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 5 Column: 5

                  ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None),
    ABI("5", "x86_64",      None),
    ABI("4", "x86",         None),
]

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              ABIs = [
    ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None),
    ABI("5", "x86_64",      None),
    ABI("4", "x86",         None),
]

            

Reported by Pylint.

platforms/android/ndk-18-api-level-24.config.py
5 issues
Undefined variable 'ABI'
Error

Line: 2 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, 24, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None, 24),
    ABI("5", "x86_64",      None, 24),
    ABI("4", "x86",         None, 24),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 3 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, 24, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None, 24),
    ABI("5", "x86_64",      None, 24),
    ABI("4", "x86",         None, 24),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 4 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, 24, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None, 24),
    ABI("5", "x86_64",      None, 24),
    ABI("4", "x86",         None, 24),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 5 Column: 5

                  ABI("2", "armeabi-v7a", None, 24, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None, 24),
    ABI("5", "x86_64",      None, 24),
    ABI("4", "x86",         None, 24),
]

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              ABIs = [
    ABI("2", "armeabi-v7a", None, 24, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None, 24),
    ABI("5", "x86_64",      None, 24),
    ABI("4", "x86",         None, 24),
]

            

Reported by Pylint.

platforms/android/ndk-18-api-level-21.config.py
5 issues
Undefined variable 'ABI'
Error

Line: 2 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, 21, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None, 21),
    ABI("5", "x86_64",      None, 21),
    ABI("4", "x86",         None, 21),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 3 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, 21, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None, 21),
    ABI("5", "x86_64",      None, 21),
    ABI("4", "x86",         None, 21),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 4 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, 21, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None, 21),
    ABI("5", "x86_64",      None, 21),
    ABI("4", "x86",         None, 21),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 5 Column: 5

                  ABI("2", "armeabi-v7a", None, 21, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None, 21),
    ABI("5", "x86_64",      None, 21),
    ABI("4", "x86",         None, 21),
]

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              ABIs = [
    ABI("2", "armeabi-v7a", None, 21, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None, 21),
    ABI("5", "x86_64",      None, 21),
    ABI("4", "x86",         None, 21),
]

            

Reported by Pylint.

platforms/android/ndk-17.config.py
5 issues
Undefined variable 'ABI'
Error

Line: 2 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None),
    ABI("5", "x86_64",      None),
    ABI("4", "x86",         None),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 3 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None),
    ABI("5", "x86_64",      None),
    ABI("4", "x86",         None),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 4 Column: 5

              ABIs = [
    ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None),
    ABI("5", "x86_64",      None),
    ABI("4", "x86",         None),
]

            

Reported by Pylint.

Undefined variable 'ABI'
Error

Line: 5 Column: 5

                  ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None),
    ABI("5", "x86_64",      None),
    ABI("4", "x86",         None),
]

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              ABIs = [
    ABI("2", "armeabi-v7a", None, cmake_vars=dict(ANDROID_ABI='armeabi-v7a with NEON')),
    ABI("3", "arm64-v8a",   None),
    ABI("5", "x86_64",      None),
    ABI("4", "x86",         None),
]

            

Reported by Pylint.

modules/python/package/cv2/load_config_py3.py
5 issues
Use of exec detected.
Security

Line: 9
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html

                  def exec_file_wrapper(fpath, g_vars, l_vars):
        with open(fpath) as f:
            code = compile(f.read(), os.path.basename(fpath), 'exec')
            exec(code, g_vars, l_vars)

            

Reported by Bandit.

Use of exec
Error

Line: 9 Column: 13

                  def exec_file_wrapper(fpath, g_vars, l_vars):
        with open(fpath) as f:
            code = compile(f.read(), os.path.basename(fpath), 'exec')
            exec(code, g_vars, l_vars)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # flake8: noqa
import os
import sys

if sys.version_info[:2] >= (3, 0):
    def exec_file_wrapper(fpath, g_vars, l_vars):
        with open(fpath) as f:
            code = compile(f.read(), os.path.basename(fpath), 'exec')
            exec(code, g_vars, l_vars)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 6 Column: 5

              import sys

if sys.version_info[:2] >= (3, 0):
    def exec_file_wrapper(fpath, g_vars, l_vars):
        with open(fpath) as f:
            code = compile(f.read(), os.path.basename(fpath), 'exec')
            exec(code, g_vars, l_vars)

            

Reported by Pylint.

Variable name "f" doesn't conform to snake_case naming style
Error

Line: 7 Column: 29

              
if sys.version_info[:2] >= (3, 0):
    def exec_file_wrapper(fpath, g_vars, l_vars):
        with open(fpath) as f:
            code = compile(f.read(), os.path.basename(fpath), 'exec')
            exec(code, g_vars, l_vars)

            

Reported by Pylint.

modules/imgproc/misc/java/test/MomentsTest.java
5 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 13

              
public class MomentsTest extends OpenCVTestCase {

    Mat data;

    @Override
    protected void setUp() throws Exception {
        super.setUp();


            

Reported by PMD.

JUnit 4 tests that set up tests should use the @Before annotation, JUnit5 tests should use @BeforeEach or @BeforeAll
Design

Line: 15

              
    Mat data;

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        data = new Mat(3,3, CvType.CV_8UC1, new Scalar(1));
        data.row(1).setTo(new Scalar(5));

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 23

                      data.row(1).setTo(new Scalar(5));
    }

    public void testAll() {
        Moments res = Imgproc.moments(data);
        assertEquals(res.m00, 21.0, EPS);
        assertEquals(res.m10, 21.0, EPS);
        assertEquals(res.m01, 21.0, EPS);
        assertEquals(res.m20, 35.0, EPS);

            

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

                      data.row(1).setTo(new Scalar(5));
    }

    public void testAll() {
        Moments res = Imgproc.moments(data);
        assertEquals(res.m00, 21.0, EPS);
        assertEquals(res.m10, 21.0, EPS);
        assertEquals(res.m01, 21.0, EPS);
        assertEquals(res.m20, 35.0, EPS);

            

Reported by PMD.

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

Line: 4

              package org.opencv.test.imgproc;

import org.opencv.test.OpenCVTestCase;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.CvType;
import org.opencv.core.Scalar;
import org.opencv.imgproc.Imgproc;
import org.opencv.imgproc.Moments;

            

Reported by PMD.

modules/gapi/include/opencv2/gapi/infer/parsers.hpp
4 issues
syntax error
Error

Line: 29

                      }
    };

    G_TYPED_KERNEL(GParseSSD, <GRects(GMat, GOpaque<Size>, float, bool, bool)>,
                   "org.opencv.nn.parsers.parseSSD") {
        static GArrayDesc outMeta(const GMatDesc&, const GOpaqueDesc&, float, bool, bool) {
            return empty_array_desc();
        }
    };

            

Reported by Cppcheck.

syntax error
Error

Line: 29

                      }
    };

    G_TYPED_KERNEL(GParseSSD, <GRects(GMat, GOpaque<Size>, float, bool, bool)>,
                   "org.opencv.nn.parsers.parseSSD") {
        static GArrayDesc outMeta(const GMatDesc&, const GOpaqueDesc&, float, bool, bool) {
            return empty_array_desc();
        }
    };

            

Reported by Cppcheck.

syntax error
Error

Line: 29

                      }
    };

    G_TYPED_KERNEL(GParseSSD, <GRects(GMat, GOpaque<Size>, float, bool, bool)>,
                   "org.opencv.nn.parsers.parseSSD") {
        static GArrayDesc outMeta(const GMatDesc&, const GOpaqueDesc&, float, bool, bool) {
            return empty_array_desc();
        }
    };

            

Reported by Cppcheck.

syntax error
Error

Line: 29

                      }
    };

    G_TYPED_KERNEL(GParseSSD, <GRects(GMat, GOpaque<Size>, float, bool, bool)>,
                   "org.opencv.nn.parsers.parseSSD") {
        static GArrayDesc outMeta(const GMatDesc&, const GOpaqueDesc&, float, bool, bool) {
            return empty_array_desc();
        }
    };

            

Reported by Cppcheck.

modules/core/misc/java/src/java/core+DMatch.java
4 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 14

                  /**
     * Query descriptor index.
     */
    public int queryIdx;
    /**
     * Train descriptor index.
     */
    public int trainIdx;
    /**

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 18

                  /**
     * Train descriptor index.
     */
    public int trainIdx;
    /**
     * Train image index.
     */
    public int imgIdx;


            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 22

                  /**
     * Train image index.
     */
    public int imgIdx;

    // javadoc: DMatch::distance
    public float distance;

    // javadoc: DMatch::DMatch()

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 25

                  public int imgIdx;

    // javadoc: DMatch::distance
    public float distance;

    // javadoc: DMatch::DMatch()
    public DMatch() {
        this(-1, -1, Float.MAX_VALUE);
    }

            

Reported by PMD.