openva/rs-video-processor

View on GitHub

Showing 5 of 61 total issues

File resolve_chyrons.php has 403 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

require_once __DIR__ . '/../includes/settings.inc.php';
require_once __DIR__ . '/../includes/functions.inc.php';

Severity: Minor
Found in bin/resolve_chyrons.php - About 5 hrs to fix

    Consider simplifying this complex logical expression.
    Open

            if (
                (substr($chyron['raw_text'], 0, 2) == 's8')
                ||
                (substr($chyron['raw_text'], 0, 2) == '58')
                ||
    Severity: Critical
    Found in bin/resolve_chyrons.php - About 2 hrs to fix

      File detect_faces.php has 258 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      error_reporting(E_ALL);
      ini_set('display_errors', 1);
      
      
      Severity: Minor
      Found in bin/detect_faces.php - About 2 hrs to fix

        Function sample_chyrons has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def sample_chyrons(directory_path):
            # Select a bunch of random screenshots
            screenshots = glob.glob(os.path.join(directory_path, '*.jpg'))
            random_screenshots = random.sample(screenshots, 200)
        
        
        Severity: Minor
        Found in bin/rs_video.py - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function extract_frames has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def extract_frames(video_path, output_folder):
            # Open the video file
            cap = cv2.VideoCapture(video_path)
            
            if not cap.isOpened():
        Severity: Minor
        Found in bin/rs_video.py - About 25 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Severity
        Category
        Status
        Source
        Language