openva/rs-video-processor

View on GitHub

Showing 357 of 357 total issues

File resolve_chyrons.php has 456 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 6 hrs to fix

    File detect_faces.php has 285 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

      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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                if (
                    (substr($chyron['raw_text'], 0, 2) == 's8')
                    ||
                    (substr($chyron['raw_text'], 0, 2) == '58')
                    ||
        Severity: Major
        Found in bin/resolve_chyrons.php and 2 other locations - About 1 hr to fix
        bin/resolve_chyrons.php on lines 150..161
        bin/resolve_chyrons.php on lines 162..173

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 98.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                elseif (
                    (substr($chyron['raw_text'], 0, 2) == 'I ')
                    ||
                    (substr($chyron['raw_text'], 0, 2) == '| ')
                    ||
        Severity: Major
        Found in bin/resolve_chyrons.php and 2 other locations - About 1 hr to fix
        bin/resolve_chyrons.php on lines 130..173
        bin/resolve_chyrons.php on lines 150..161

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 98.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                elseif (
                    (substr($chyron['raw_text'], 0, 3) == 'hjr')
                    ||
                    (substr($chyron['raw_text'], 0, 3) == 'pur')
                    ||
        Severity: Major
        Found in bin/resolve_chyrons.php and 2 other locations - About 1 hr to fix
        bin/resolve_chyrons.php on lines 130..173
        bin/resolve_chyrons.php on lines 162..173

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 98.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 14 and the first side effect is on line 3.
        Open

        <?php
        Severity: Minor
        Found in bin/detect_faces.php by phpcodesniffer

        A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 21 and the first side effect is on line 12.
        Open

        <?php
        Severity: Minor
        Found in bin/get_video.php by phpcodesniffer

        A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 13 and the first side effect is on line 3.
        Open

        <?php
        Severity: Minor
        Found in bin/resolve_chyrons.php by phpcodesniffer

        A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 13 and the first side effect is on line 3.
        Open

        <?php
        Severity: Minor
        Found in bin/save_chyrons.php by phpcodesniffer

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            if ((isset($bill) && strlen($bill) > 0))
            {
        
                $invalid = 0;
                foreach (str_split($bill) as $character)
        Severity: Minor
        Found in bin/save_chyrons.php and 1 other location - About 45 mins to fix
        bin/save_chyrons.php on lines 183..206

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 80.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            elseif (isset($legislator))
            {
        
                $invalid = 0;
                foreach (str_split($legislator) as $character)
        Severity: Minor
        Found in bin/save_chyrons.php and 1 other location - About 45 mins to fix
        bin/save_chyrons.php on lines 160..206

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 80.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            while ($tmp = mysql_fetch_array($result))
            {
                $tmp['raw_text'] = stripslashes($tmp['raw_text']);
                # We can't use a newline in an array key.
                $tmp['raw_text'] = str_replace("\n", ' ', $tmp['raw_text']);
        Severity: Minor
        Found in bin/resolve_chyrons.php and 1 other location - About 40 mins to fix
        bin/resolve_chyrons.php on lines 370..378

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 78.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            while ($tmp = mysql_fetch_array($result))
            {
        
                $tmp['raw_text'] = stripslashes($tmp['raw_text']);
                # We can't use a newline in an array key.
        Severity: Minor
        Found in bin/resolve_chyrons.php and 1 other location - About 40 mins to fix
        bin/resolve_chyrons.php on lines 350..356

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 78.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Blank line found at end of control structure
        Open

        
        
        Severity: Minor
        Found in bin/get_captions.php by phpcodesniffer

        Blank line found at start of control structure
        Open

        {

        Blank line found at start of control structure
        Open

            {
        Severity: Minor
        Found in bin/detect_faces.php by phpcodesniffer

        TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE"
        Open

        if ($captions->parse_webvtt() === FALSE)
        Severity: Minor
        Found in bin/process_captions.php by phpcodesniffer

        TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE"
        Open

        if ($captions->captions_to_database() === FALSE)
        Severity: Minor
        Found in bin/process_captions.php by phpcodesniffer

        TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE"
        Open

            if (file_exists($video['file']) === FALSE)
        Severity
        Category
        Status
        Source
        Language