amtgard/ORK3

View on GitHub
system/lib/Barcode.php

Summary

Maintainability
F
3 wks
Test Coverage

File Barcode.php has 1015 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*
 *  BarCode Coder Library (BCC Library)
 *  BCCL Version 2.0.1
 *  Porting : Barcode PHP
Severity: Major
Found in system/lib/Barcode.php - About 2 days to fix

    Function digitToFPDFRenderer has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function digitToFPDFRenderer($pdf, $color, $xi, $yi, $angle, $mw, $mh, $digit){
          $lines = count($digit);
          $columns = count($digit[0]);
          $angle = deg2rad(-$angle);
          $cos = cos($angle);
    Severity: Minor
    Found in system/lib/Barcode.php - About 1 day 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 digitToGDRenderer has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function digitToGDRenderer($gd, $color, $xi, $yi, $angle, $mw, $mh, $digit){
          $lines = count($digit);
          $columns = count($digit[0]);
          $angle = deg2rad(-$angle);
          $cos = cos($angle);
    Severity: Minor
    Found in system/lib/Barcode.php - About 1 day 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 addFinderPattern has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

        static private function addFinderPattern($datamatrix, $rowsRegion, $colsRegion, $rowsRegionCW, $colsRegionCW){ // Add the finder pattern
          $totalRowsCW = ($rowsRegionCW+2) * $rowsRegion;
          $totalColsCW = ($colsRegionCW+2) * $colsRegion;
          
          $datamatrixTemp = array();
    Severity: Minor
    Found in system/lib/Barcode.php - About 5 hrs 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 getDigit has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        static public function getDigit($code, $crc, $type){
          $code = self::compute($code, $crc, $type);
          if ($code == '') return($code);
          $result = '';
          
    Severity: Minor
    Found in system/lib/Barcode.php - About 4 hrs 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 getDigit has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        static public function getDigit($code){
          $tableB = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
          $result = "";
          $sum = 0;
          $isum = 0;
    Severity: Minor
    Found in system/lib/Barcode.php - About 3 hrs 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 _draw has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        static private function _draw($call, $res, $color, $x, $y, $angle, $type, $datas, $width, $height){
          $digit = '';
          $hri   = '';
          $code  = '';
          $crc   = true;
    Severity: Minor
    Found in system/lib/Barcode.php - About 3 hrs 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

    Method _draw has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static private function _draw($call, $res, $color, $x, $y, $angle, $type, $datas, $width, $height){
          $digit = '';
          $hri   = '';
          $code  = '';
          $crc   = true;
    Severity: Major
    Found in system/lib/Barcode.php - About 2 hrs to fix

      Function next has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          static private function next($etape, $totalRows, $totalCols, $codeWordsBits, &$datamatrix, &$assigned){ // Place codewords into the matrix
            $chr = 0; // Place of the 8st bit from the first character to [4][0]
            $row = 4;
            $col = 0;
            
      Severity: Minor
      Found in system/lib/Barcode.php - About 2 hrs 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

      Method digitToFPDFRenderer has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function digitToFPDFRenderer($pdf, $color, $xi, $yi, $angle, $mw, $mh, $digit){
            $lines = count($digit);
            $columns = count($digit[0]);
            $angle = deg2rad(-$angle);
            $cos = cos($angle);
      Severity: Major
      Found in system/lib/Barcode.php - About 2 hrs to fix

        Function addReedSolomonCW has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            static private function addReedSolomonCW($nSolomonCW, $coeffTab, $nDataCW, &$dataTab, $blocks){ // Add the Reed Solomon codewords
              $temp = 0;
              $errorBlocks = $nSolomonCW / $blocks;
              $correctionCW = array();
        
        
        Severity: Minor
        Found in system/lib/Barcode.php - About 2 hrs 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

        Method digitToGDRenderer has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static function digitToGDRenderer($gd, $color, $xi, $yi, $angle, $mw, $mh, $digit){
              $lines = count($digit);
              $columns = count($digit[0]);
              $angle = deg2rad(-$angle);
              $cos = cos($angle);
        Severity: Major
        Found in system/lib/Barcode.php - About 2 hrs to fix

          Function compute has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              static public function compute($code, $crc){
                if (is_array($crc)){
                  if ($crc['crc1'] == 'mod10'){
                    $code = self::computeMod10($code);
                  } else if ($crc['crc1'] == 'mod11'){
          Severity: Minor
          Found in system/lib/Barcode.php - About 2 hrs 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

          Method getDigit has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static public function getDigit($code){
                $tableB = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
                $result = "";
                $sum = 0;
                $isum = 0;
          Severity: Minor
          Found in system/lib/Barcode.php - About 1 hr to fix

            Method next has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                static private function next($etape, $totalRows, $totalCols, $codeWordsBits, &$datamatrix, &$assigned){ // Place codewords into the matrix
                  $chr = 0; // Place of the 8st bit from the first character to [4][0]
                  $row = 4;
                  $col = 0;
                  
            Severity: Minor
            Found in system/lib/Barcode.php - About 1 hr to fix

              Method getDigit has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  static public function getDigit($text, $rectangular){
                    $dataCodeWords = self::encodeDataCodeWordsASCII($text); // Code the text in the ASCII mode
                    $dataCWCount = count($dataCodeWords);
                    $index = self::selectIndex($dataCWCount, $rectangular); // Select the index for the data tables
                    $totalDataCWCount = self::$dataCWCount[$index]; // Number of data CW
              Severity: Minor
              Found in system/lib/Barcode.php - About 1 hr to fix

                Method addFinderPattern has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    static private function addFinderPattern($datamatrix, $rowsRegion, $colsRegion, $rowsRegionCW, $colsRegionCW){ // Add the finder pattern
                      $totalRowsCW = ($rowsRegionCW+2) * $rowsRegion;
                      $totalColsCW = ($colsRegionCW+2) * $colsRegion;
                      
                      $datamatrixTemp = array();
                Severity: Minor
                Found in system/lib/Barcode.php - About 1 hr to fix

                  Method getDigit has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      static public function getDigit($code, $crc){
                        $table = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%____*'; // _ => ($), (%), (/) et (+)
                        $result = '';
                        
                        if (strpos($code, '*') !== false) return('');
                  Severity: Minor
                  Found in system/lib/Barcode.php - About 1 hr to fix

                    Method _draw has 10 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        static private function _draw($call, $res, $color, $x, $y, $angle, $type, $datas, $width, $height){
                    Severity: Major
                    Found in system/lib/Barcode.php - About 1 hr to fix

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

                          static public function getDigit($code, $type){
                            // Check len (12 for ean13, 7 for ean8)
                            $len = $type == 'ean8' ? 7 : 12;
                            $code = substr($code, 0, $len);
                            if (!preg_match('`[0-9]{'.$len.'}`', $code)) return('');
                      Severity: Minor
                      Found in system/lib/Barcode.php - 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

                      Method getDigit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          static public function getDigit($code, $crc, $type){
                            $code = self::compute($code, $crc, $type);
                            if ($code == '') return($code);
                            $result = '';
                            
                      Severity: Minor
                      Found in system/lib/Barcode.php - About 1 hr to fix

                        Method getDigit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            static public function getDigit($code){
                              if (preg_match('`[^0-9\-]`', $code)) return '';
                              $result = '';
                              $intercharacter = '0';
                              
                        Severity: Minor
                        Found in system/lib/Barcode.php - About 1 hr to fix

                          Method gd has 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              static public function gd($res, $color, $x, $y, $angle, $type, $datas, $width = null, $height = null){
                          Severity: Major
                          Found in system/lib/Barcode.php - About 1 hr to fix

                            Method fpdf has 9 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                static public function fpdf($res, $color, $x, $y, $angle, $type, $datas, $width = null, $height = null){
                            Severity: Major
                            Found in system/lib/Barcode.php - About 1 hr to fix

                              Method digitToGDRenderer has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  private static function digitToGDRenderer($gd, $color, $xi, $yi, $angle, $mw, $mh, $digit){
                              Severity: Major
                              Found in system/lib/Barcode.php - About 1 hr to fix

                                Method result has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    static private function result($xi, $yi, $columns, $lines, $mw, $mh, $cos, $sin){
                                Severity: Major
                                Found in system/lib/Barcode.php - About 1 hr to fix

                                  Method digitToFPDFRenderer has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      private static function digitToFPDFRenderer($pdf, $color, $xi, $yi, $angle, $mw, $mh, $digit){
                                  Severity: Major
                                  Found in system/lib/Barcode.php - About 1 hr to fix

                                    Function compute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        static public function compute($code, $crc, $type){
                                          if (! $crc) {
                                            if (strlen($code) % 2) $code = '0' . $code;
                                          } else {
                                            if ( ($type == 'int25') && (strlen($code) % 2 == 0) ) $code = '0' . $code;
                                    Severity: Minor
                                    Found in system/lib/Barcode.php - About 55 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

                                    Function encodeDataCodeWordsASCII has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        static private function encodeDataCodeWordsASCII($text) {
                                          $dataCodeWords = array();
                                          $n = 0;
                                          $len = strlen($text);
                                          for ($i=0; $i<$len; $i++){
                                    Severity: Minor
                                    Found in system/lib/Barcode.php - About 55 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

                                    Method patternShapeStandard has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        static private function patternShapeStandard(&$datamatrix, &$assigned, $bits, $row, $col, $totalRows, $totalCols){ // Place bits in the matrix (standard or special case)
                                    Severity: Major
                                    Found in system/lib/Barcode.php - About 50 mins to fix

                                      Method placeBitInDatamatrix has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          static private function placeBitInDatamatrix(&$datamatrix, &$assigned, $bit, $row, $col, $totalRows, $totalCols){ // Put a bit into the matrix
                                      Severity: Major
                                      Found in system/lib/Barcode.php - About 50 mins to fix

                                        Function getDigit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            static public function getDigit($code, $crc){
                                              $table = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%____*'; // _ => ($), (%), (/) et (+)
                                              $result = '';
                                              
                                              if (strpos($code, '*') !== false) return('');
                                        Severity: Minor
                                        Found in system/lib/Barcode.php - About 45 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

                                        Method next has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            static private function next($etape, $totalRows, $totalCols, $codeWordsBits, &$datamatrix, &$assigned){ // Place codewords into the matrix
                                        Severity: Minor
                                        Found in system/lib/Barcode.php - About 45 mins to fix

                                          Method _rotate has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              static private function _rotate($x1, $y1, $cos, $sin , &$x, &$y){
                                          Severity: Minor
                                          Found in system/lib/Barcode.php - About 45 mins to fix

                                            Method patternShapeSpecial3 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                static private function patternShapeSpecial3(&$datamatrix, &$assigned, $bits, $totalRows, $totalCols ){
                                            Severity: Minor
                                            Found in system/lib/Barcode.php - About 35 mins to fix

                                              Method addReedSolomonCW has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                  static private function addReedSolomonCW($nSolomonCW, $coeffTab, $nDataCW, &$dataTab, $blocks){ // Add the Reed Solomon codewords
                                              Severity: Minor
                                              Found in system/lib/Barcode.php - About 35 mins to fix

                                                Method patternShapeSpecial4 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                    static private function patternShapeSpecial4(&$datamatrix, &$assigned, $bits, $totalRows, $totalCols ){
                                                Severity: Minor
                                                Found in system/lib/Barcode.php - About 35 mins to fix

                                                  Method rotate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                      static public function rotate($x1, $y1, $angle , &$x, &$y){
                                                  Severity: Minor
                                                  Found in system/lib/Barcode.php - About 35 mins to fix

                                                    Method patternShapeSpecial2 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                        static private function patternShapeSpecial2(&$datamatrix, &$assigned, $bits, $totalRows, $totalCols ){
                                                    Severity: Minor
                                                    Found in system/lib/Barcode.php - About 35 mins to fix

                                                      Method addFinderPattern has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                          static private function addFinderPattern($datamatrix, $rowsRegion, $colsRegion, $rowsRegionCW, $colsRegionCW){ // Add the finder pattern
                                                      Severity: Minor
                                                      Found in system/lib/Barcode.php - About 35 mins to fix

                                                        Method patternShapeSpecial1 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                            static private function patternShapeSpecial1(&$datamatrix, &$assigned, $bits, $totalRows, $totalCols ){
                                                        Severity: Minor
                                                        Found in system/lib/Barcode.php - About 35 mins to fix

                                                          Function selectIndex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              static private function selectIndex($dataCodeWordsCount, $rectangular){ // CHOOSE THE GOOD INDEX FOR TABLES
                                                                if (($dataCodeWordsCount<1 || $dataCodeWordsCount>1558) && !$rectangular) return -1;
                                                                if (($dataCodeWordsCount<1 || $dataCodeWordsCount>49) && $rectangular)  return -1;
                                                                
                                                                $n = $rectangular ? 24 : 0;
                                                          Severity: Minor
                                                          Found in system/lib/Barcode.php - About 35 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

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

                                                              static private function calculSolFactorTable($solomonCWCount){ // CALCULATE THE REED SOLOMON FACTORS
                                                                $g = array_fill(0, $solomonCWCount+1, 1);
                                                                for($i = 1; $i <= $solomonCWCount; $i++) {
                                                                  for($j = $i - 1; $j >= 0; $j--) {
                                                                    $g[$j] = self::champGaloisDoub($g[$j], $i);  
                                                          Severity: Minor
                                                          Found in system/lib/Barcode.php - 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

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

                                                              static public function getDigit($code){
                                                                $table = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*';
                                                                $result = '';
                                                                $intercharacter = '0';
                                                                
                                                          Severity: Minor
                                                          Found in system/lib/Barcode.php - 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

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

                                                              static private function patternShapeSpecial2(&$datamatrix, &$assigned, $bits, $totalRows, $totalCols ){
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[0], $totalRows-3,  0, $totalRows, $totalCols);
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[1], $totalRows-2,  0, $totalRows, $totalCols);
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[2], $totalRows-1,  0, $totalRows, $totalCols);
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[3], 0, $totalCols-4, $totalRows, $totalCols);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 2 other locations - About 1 day to fix
                                                          system/lib/Barcode.php on lines 1080..1089
                                                          system/lib/Barcode.php on lines 1100..1109

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

                                                          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

                                                              static private function patternShapeSpecial1(&$datamatrix, &$assigned, $bits, $totalRows, $totalCols ){
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[0], $totalRows-1,  0, $totalRows, $totalCols);
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[1], $totalRows-1,  1, $totalRows, $totalCols);
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[2], $totalRows-1,  2, $totalRows, $totalCols);
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[3], 0, $totalCols-2, $totalRows, $totalCols);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 2 other locations - About 1 day to fix
                                                          system/lib/Barcode.php on lines 1090..1099
                                                          system/lib/Barcode.php on lines 1100..1109

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

                                                          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

                                                              static private function patternShapeSpecial3(&$datamatrix, &$assigned, $bits, $totalRows, $totalCols ){
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[0], $totalRows-3,  0, $totalRows, $totalCols);
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[1], $totalRows-2,  0, $totalRows, $totalCols);
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[2], $totalRows-1,  0, $totalRows, $totalCols);
                                                                self::placeBitInDatamatrix($datamatrix, $assigned, $bits[3], 0, $totalCols-2, $totalRows, $totalCols);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 2 other locations - About 1 day to fix
                                                          system/lib/Barcode.php on lines 1080..1089
                                                          system/lib/Barcode.php on lines 1090..1099

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

                                                          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 ($angle == 0){
                                                                          if ($px > 2){
                                                                            imagefilledrectangle($gd, $xt, $yi + $y * $mh, $xt + $px - 1, $yi + ($y + 1) * $mh, $color);
                                                                          } else {
                                                                            for($i = 0; $i < $px; $i++){
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 1 other location - About 1 day to fix
                                                          system/lib/Barcode.php on lines 186..200

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

                                                          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 ($angle == 0){
                                                                      if ($px > 2){
                                                                        imagefilledrectangle($gd, $xt, $yi + $y * $mh, $xt + $px - 1, $yi + ($y + 1) * $mh, $color);
                                                                      } else {
                                                                        for($i = 0; $i < $px; $i++){
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 1 other location - About 1 day to fix
                                                          system/lib/Barcode.php on lines 162..176

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

                                                          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 ($angle == 0){
                                                                      if ($px > 2){
                                                                        $pdf->rect($xt, $yi + $y * $mh, $px - 1, $mh,  'F');
                                                                      } else {
                                                                        for($i = 0; $i < $px; $i++){
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 1 other location - About 1 day to fix
                                                          system/lib/Barcode.php on lines 242..256

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

                                                          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 ($angle == 0){
                                                                          if ($px > 2){
                                                                            $pdf->rect($xt, $yi + $y * $mh, $px - 1, $mh,  'F');
                                                                          } else {
                                                                            for($i = 0; $i < $px; $i++){
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 1 other location - About 1 day to fix
                                                          system/lib/Barcode.php on lines 266..280

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

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

                                                              static private $dataRegionRows = array(
                                                                                  8, 10, 12, 14, 16, 18, 20, 22, // Number of rows per region
                                                                                  24, 14, 16, 18, 20, 22, 24, 14, 16, 18, 20, 22, 24, 18, 20, 22,
                                                                                  6,  6, 10, 10, 14, 14);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 847..850
                                                          system/lib/Barcode.php on lines 851..854
                                                          system/lib/Barcode.php on lines 855..858
                                                          system/lib/Barcode.php on lines 859..862
                                                          system/lib/Barcode.php on lines 863..866
                                                          system/lib/Barcode.php on lines 867..870
                                                          system/lib/Barcode.php on lines 875..878
                                                          system/lib/Barcode.php on lines 879..882
                                                          system/lib/Barcode.php on lines 883..886
                                                          system/lib/Barcode.php on lines 887..890

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

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

                                                              static private $regionCols = array(
                                                                                  1, 1, 1, 1, 1, 1, 1, 1, // Number of regions per column
                                                                                  1, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 6, 6, 6,
                                                                                  1, 2, 1, 2, 2, 2);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 847..850
                                                          system/lib/Barcode.php on lines 851..854
                                                          system/lib/Barcode.php on lines 855..858
                                                          system/lib/Barcode.php on lines 859..862
                                                          system/lib/Barcode.php on lines 863..866
                                                          system/lib/Barcode.php on lines 867..870
                                                          system/lib/Barcode.php on lines 871..874
                                                          system/lib/Barcode.php on lines 875..878
                                                          system/lib/Barcode.php on lines 879..882
                                                          system/lib/Barcode.php on lines 887..890

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

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

                                                              static private $solomonCWCount = array(
                                                                                  5, 7, 10, 12, 14, 18, 20, 24, 28, // Number of Reed-Solomon codewords for the datamatrix
                                                                                  36, 42, 48, 56, 68, 84, 112, 144, 192, 224, 272, 336, 408, 496, 620,
                                                                                  7, 11, 14, 18, 24, 28);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 847..850
                                                          system/lib/Barcode.php on lines 851..854
                                                          system/lib/Barcode.php on lines 855..858
                                                          system/lib/Barcode.php on lines 859..862
                                                          system/lib/Barcode.php on lines 863..866
                                                          system/lib/Barcode.php on lines 871..874
                                                          system/lib/Barcode.php on lines 875..878
                                                          system/lib/Barcode.php on lines 879..882
                                                          system/lib/Barcode.php on lines 883..886
                                                          system/lib/Barcode.php on lines 887..890

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

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

                                                              static private $dataRegionCols = array(
                                                                                  8, 10, 12, 14, 16, 18, 20, 22, // Number of columns per region
                                                                                  24, 14, 16, 18, 20, 22, 24, 14, 16, 18, 20, 22, 24, 18, 20, 22,
                                                                                  16, 14, 24, 16, 16, 22);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 847..850
                                                          system/lib/Barcode.php on lines 851..854
                                                          system/lib/Barcode.php on lines 855..858
                                                          system/lib/Barcode.php on lines 859..862
                                                          system/lib/Barcode.php on lines 863..866
                                                          system/lib/Barcode.php on lines 867..870
                                                          system/lib/Barcode.php on lines 871..874
                                                          system/lib/Barcode.php on lines 879..882
                                                          system/lib/Barcode.php on lines 883..886
                                                          system/lib/Barcode.php on lines 887..890

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

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

                                                              static private $lengthCols = array(
                                                                                  10, 12, 14, 16, 18, 20, 22, 24, 26,  // Number of columns for the entire datamatrix
                                                                                  32, 36, 40, 44, 48, 52, 64, 72, 80, 88, 96, 104, 120, 132, 144,
                                                                                  18, 32, 26, 36, 36, 48);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 847..850
                                                          system/lib/Barcode.php on lines 855..858
                                                          system/lib/Barcode.php on lines 859..862
                                                          system/lib/Barcode.php on lines 863..866
                                                          system/lib/Barcode.php on lines 867..870
                                                          system/lib/Barcode.php on lines 871..874
                                                          system/lib/Barcode.php on lines 875..878
                                                          system/lib/Barcode.php on lines 879..882
                                                          system/lib/Barcode.php on lines 883..886
                                                          system/lib/Barcode.php on lines 887..890

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

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

                                                              static private $interleavedBlocks = array(
                                                                                  1, 1, 1, 1, 1, 1, 1, 1, // Number of blocks
                                                                                  1, 1, 1, 1, 1, 1, 2, 2, 4, 4, 4, 4, 6, 6, 8, 8,
                                                                                  1, 1, 1, 1, 1, 1);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 847..850
                                                          system/lib/Barcode.php on lines 851..854
                                                          system/lib/Barcode.php on lines 855..858
                                                          system/lib/Barcode.php on lines 859..862
                                                          system/lib/Barcode.php on lines 863..866
                                                          system/lib/Barcode.php on lines 867..870
                                                          system/lib/Barcode.php on lines 871..874
                                                          system/lib/Barcode.php on lines 875..878
                                                          system/lib/Barcode.php on lines 879..882
                                                          system/lib/Barcode.php on lines 883..886

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

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

                                                              static private $lengthRows = array(
                                                                                  10, 12, 14, 16, 18, 20, 22, 24, 26,  // 24 squares et 6 rectangular
                                                                                  32, 36, 40, 44, 48, 52, 64, 72, 80,  88, 96, 104, 120, 132, 144,
                                                                                  8, 8, 12, 12, 16, 16);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 851..854
                                                          system/lib/Barcode.php on lines 855..858
                                                          system/lib/Barcode.php on lines 859..862
                                                          system/lib/Barcode.php on lines 863..866
                                                          system/lib/Barcode.php on lines 867..870
                                                          system/lib/Barcode.php on lines 871..874
                                                          system/lib/Barcode.php on lines 875..878
                                                          system/lib/Barcode.php on lines 879..882
                                                          system/lib/Barcode.php on lines 883..886
                                                          system/lib/Barcode.php on lines 887..890

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

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

                                                              static private $mappingCols = array(
                                                                                  8, 10, 12, 14, 16, 18, 20, 22, 24,  // Number of columns for the mapping matrix
                                                                                  28, 32, 36, 40, 44, 48, 56, 64, 72, 80, 88, 96, 108, 120, 132,
                                                                                  16, 28, 24, 32, 32, 44);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 847..850
                                                          system/lib/Barcode.php on lines 851..854
                                                          system/lib/Barcode.php on lines 855..858
                                                          system/lib/Barcode.php on lines 863..866
                                                          system/lib/Barcode.php on lines 867..870
                                                          system/lib/Barcode.php on lines 871..874
                                                          system/lib/Barcode.php on lines 875..878
                                                          system/lib/Barcode.php on lines 879..882
                                                          system/lib/Barcode.php on lines 883..886
                                                          system/lib/Barcode.php on lines 887..890

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

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

                                                              static private $regionRows = array(
                                                                                  1, 1, 1, 1, 1, 1, 1, 1, // Number of regions per row
                                                                                  1, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 6, 6, 6,
                                                                                  1, 1, 1, 1, 1, 1);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 847..850
                                                          system/lib/Barcode.php on lines 851..854
                                                          system/lib/Barcode.php on lines 855..858
                                                          system/lib/Barcode.php on lines 859..862
                                                          system/lib/Barcode.php on lines 863..866
                                                          system/lib/Barcode.php on lines 867..870
                                                          system/lib/Barcode.php on lines 871..874
                                                          system/lib/Barcode.php on lines 875..878
                                                          system/lib/Barcode.php on lines 883..886
                                                          system/lib/Barcode.php on lines 887..890

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

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

                                                              static private $dataCWCount = array(
                                                                                  3, 5, 8, 12,  18,  22,  30,  36,  // Number of data codewords for the datamatrix
                                                                                  44, 62, 86, 114, 144, 174, 204, 280, 368, 456, 576, 696, 816, 1050, 
                                                                                  1304, 1558, 5, 10, 16, 22, 32, 49);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 847..850
                                                          system/lib/Barcode.php on lines 851..854
                                                          system/lib/Barcode.php on lines 855..858
                                                          system/lib/Barcode.php on lines 859..862
                                                          system/lib/Barcode.php on lines 867..870
                                                          system/lib/Barcode.php on lines 871..874
                                                          system/lib/Barcode.php on lines 875..878
                                                          system/lib/Barcode.php on lines 879..882
                                                          system/lib/Barcode.php on lines 883..886
                                                          system/lib/Barcode.php on lines 887..890

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

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

                                                              static private $mappingRows = array(
                                                                                  8, 10, 12, 14, 16, 18, 20, 22, 24,  // Number of rows for the mapping matrix
                                                                                  28, 32, 36, 40, 44, 48, 56, 64, 72, 80, 88, 96, 108, 120, 132,
                                                                                  6, 6, 10, 10, 14, 14);
                                                          Severity: Major
                                                          Found in system/lib/Barcode.php and 10 other locations - About 50 mins to fix
                                                          system/lib/Barcode.php on lines 847..850
                                                          system/lib/Barcode.php on lines 851..854
                                                          system/lib/Barcode.php on lines 859..862
                                                          system/lib/Barcode.php on lines 863..866
                                                          system/lib/Barcode.php on lines 867..870
                                                          system/lib/Barcode.php on lines 871..874
                                                          system/lib/Barcode.php on lines 875..878
                                                          system/lib/Barcode.php on lines 879..882
                                                          system/lib/Barcode.php on lines 883..886
                                                          system/lib/Barcode.php on lines 887..890

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

                                                          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

                                                          There are no issues that match your filters.

                                                          Category
                                                          Status