openva/rs-machine

View on GitHub

Showing 408 of 408 total issues

File cleanup.php has 685 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

###
# MISC. DATA CLEAN UP FUNCTIONS
#
Severity: Major
Found in cron/cleanup.php - About 1 day to fix

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

                    if ($this_vote['R']['Y'] == $this_vote['R']['N']) {
                        $this_vote['R']['rating'] = 0;
                    } elseif (($this_vote['R']['Y'] == 0) || ($this_vote['R']['N'] == 0)) {
                        $this_vote['R']['rating'] = 1;
                    } elseif ($this_vote['R']['Y'] < $this_vote['R']['N']) {
    Severity: Major
    Found in cron/vote_partisanship.php and 1 other location - About 1 day to fix
    cron/vote_partisanship.php on lines 81..89

    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 249.

    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

                    if ($this_vote['D']['Y'] == $this_vote['D']['N']) {
                        $this_vote['D']['rating'] = 0;
                    } elseif (($this_vote['D']['Y'] == 0) || ($this_vote['D']['N'] == 0)) {
                        $this_vote['D']['rating'] = 1;
                    } elseif ($this_vote['D']['Y'] < $this_vote['D']['N']) {
    Severity: Major
    Found in cron/vote_partisanship.php and 1 other location - About 1 day to fix
    cron/vote_partisanship.php on lines 92..100

    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 249.

    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

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

     <?php
    
    // Store the prior match and try it as the first option on the next time around. No need to
    // start from zero when we know there's a pretty good chance that each name is going to
    // occur repeatedly.
    Severity: Minor
    Found in utilities/resolve_chyrons.php - About 6 hrs to fix

      File meetings.php has 282 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      ###
      # Retrieve and Store the Meeting Schedule
      #
      Severity: Minor
      Found in cron/meetings.php - About 2 hrs to fix

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

            if ($total > 0) {
                arsort($tmp);
        
                # Populate an array that we use to determine overall partisanship. 0 = Democratic and 100 =
                # Republican. Because our number is based on the majority support, we need to rescale it.
        Severity: Major
        Found in cron/partisanship.php and 2 other locations - About 2 hrs to fix
        cron/partisanship.php on lines 45..59
        cron/partisanship.php on lines 115..129

        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 129.

        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 3 locations. Consider refactoring.
        Open

            if ($total > 0) {
                arsort($tmp);
        
                # Populate an array that we use to determine overall partisanship. 0 = Democratic and 100 =
                # Republican. Because our number is based on the majority support, we need to rescale it.
        Severity: Major
        Found in cron/partisanship.php and 2 other locations - About 2 hrs to fix
        cron/partisanship.php on lines 45..59
        cron/partisanship.php on lines 79..93

        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 129.

        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 3 locations. Consider refactoring.
        Open

            if ($total > 0) {
                arsort($tmp);
        
                # Populate an array that we use to determine overall partisanship. 0 = Democratic and 100 =
                # Republican. Because our number is based on the majority support, we need to rescale it.
        Severity: Major
        Found in cron/partisanship.php and 2 other locations - About 2 hrs to fix
        cron/partisanship.php on lines 79..93
        cron/partisanship.php on lines 115..129

        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 129.

        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

        File legislators.php has 266 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /*
         * Connect to the database
         */
        Severity: Minor
        Found in cron/legislators.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 utilities/resolve_chyrons.php - About 2 hrs to fix

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

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

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

                  foreach ($html as $line) {
                      if (stristr($line, 'legp504') !== false) {
                          ereg('href="/cgi-bin/legp504\.exe\?' . $bill['session_lis_id'] . '\+mbr\+([A-Z]{1}[0-9]*)"', $line, $copatron);
                          if (!empty($copatron[1])) {
                              # Build up an array of copatrons for this bill.
              Severity: Major
              Found in cron/copatrons-manual.php and 1 other location - About 1 hr to fix
              cron/copatrons.php on lines 76..92

              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 113.

              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

                  foreach ($html as $line) {
                      if (stristr($line, 'legp504') !== false) {
                          //ereg('href="/cgi-bin/legp504\.exe\?'.$bill['session_lis_id'].'\+mbr\+([A-Z]{1}[0-9]*)"', $line, $copatron);
                          preg_match('/href="\/cgi-bin\/legp504\.exe\?' . $bill['session_lis_id'] . '\+mbr\+([A-Z]{1}[0-9]*)"/', $line, $copatron);
              
              
              Severity: Major
              Found in cron/copatrons.php and 1 other location - About 1 hr to fix
              cron/copatrons-manual.php on lines 87..101

              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 113.

              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

              if (file_exists($hash_path)) {
                  $hashes = file_get_contents($hash_path);
                  if ($hashes !== false) {
                      $hashes = unserialize($hashes);
                  } else {
              Severity: Major
              Found in cron/summaries.php and 1 other location - About 1 hr to fix
              cron/bills.php on lines 18..30

              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 106.

              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

              if (file_exists($hash_path)) {
                  $hashes = file_get_contents($hash_path);
                  if ($hashes !== false) {
                      $hashes = unserialize($hashes);
                  } else {
              Severity: Major
              Found in cron/bills.php and 1 other location - About 1 hr to fix
              cron/summaries.php on lines 41..53

              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 106.

              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

                       if (
                           (substr($chyron['raw_text'], 0, 2) == 's8')
                           ||
                           (substr($chyron['raw_text'], 0, 2) == '58')
                           ||
              Severity: Major
              Found in utilities/resolve_chyrons.php and 2 other locations - About 55 mins to fix
              utilities/resolve_chyrons.php on lines 152..162
              utilities/resolve_chyrons.php on lines 162..172

              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 utilities/resolve_chyrons.php and 2 other locations - About 55 mins to fix
              utilities/resolve_chyrons.php on lines 136..172
              utilities/resolve_chyrons.php on lines 162..172

              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 utilities/resolve_chyrons.php and 2 other locations - About 55 mins to fix
              utilities/resolve_chyrons.php on lines 136..172
              utilities/resolve_chyrons.php on lines 152..162

              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 15 and the first side effect is on line 3.
              Open

              <?php
              Severity: Minor
              Found in utilities/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 1.
              Open

               <?php
              Severity
              Category
              Status
              Source
              Language