amtgard/ORK3

View on GitHub
system/lib/phpqrcode/phpqrcode.php

Summary

Maintainability
F
5 mos
Test Coverage

File phpqrcode.php has 2160 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/*
 * PHP QR Code encoder
 *
Severity: Major
Found in system/lib/phpqrcode/phpqrcode.php - About 5 days to fix

    Function evaluateSymbol has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

            public function evaluateSymbol($width, $frame)
            {
                $head = 0;
                $demerit = 0;
    
    
    Severity: Minor
    Found in system/lib/phpqrcode/phpqrcode.php - About 6 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 eat8 has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

            public function eat8()
            {
                $la = QRspec::lengthIndicator(QR_MODE_AN, $this->input->getVersion());
                $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion());
    
    
    Severity: Minor
    Found in system/lib/phpqrcode/phpqrcode.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 calcN1N3 has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

            public function calcN1N3($length)
            {
                $demerit = 0;
    
                for($i=0; $i<$length; $i++) {
    Severity: Minor
    Found in system/lib/phpqrcode/phpqrcode.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

    QRinput has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

        class QRinput {
    
            public $items;
            
            private $version;
    Severity: Minor
    Found in system/lib/phpqrcode/phpqrcode.php - About 3 hrs to fix

      QRspec has 27 functions (exceeds 20 allowed). Consider refactoring.
      Open

          class QRspec {
          
              public static $capacity = array(
                  array(  0,    0, 0, array(   0,    0,    0,    0)),
                  array( 21,   26, 0, array(   7,   10,   13,   17)), // 1
      Severity: Minor
      Found in system/lib/phpqrcode/phpqrcode.php - About 3 hrs to fix

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

                public function identifyMode($pos)
                {
                    if ($pos >= strlen($this->dataStr)) 
                        return QR_MODE_NUL;
                        
        Severity: Minor
        Found in system/lib/phpqrcode/phpqrcode.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

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

                public static function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
                {
                    // Common code for intializing a Reed-Solomon control block (char or int symbols)
                    // Copyright 2004 Phil Karn, KA9Q
                    // May be used under the terms of the GNU Lesser General Public License (LGPL)
        Severity: Minor
        Found in system/lib/phpqrcode/phpqrcode.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

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

                public static function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
                {
                    foreach(self::$items as $rs) {
                        if($rs->pad != $pad)       continue;
                        if($rs->nroots != $nroots) continue;
        Severity: Minor
        Found in system/lib/phpqrcode/phpqrcode.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

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

                public function next()
                {
                    do {
                    
                        if($this->bit == -1) {
        Severity: Minor
        Found in system/lib/phpqrcode/phpqrcode.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 init_rs_char has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public static function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
                {
                    // Common code for intializing a Reed-Solomon control block (char or int symbols)
                    // Copyright 2004 Phil Karn, KA9Q
                    // May be used under the terms of the GNU Lesser General Public License (LGPL)
        Severity: Major
        Found in system/lib/phpqrcode/phpqrcode.php - About 2 hrs to fix

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

                  public function eatAn()
                  {
                      $la = QRspec::lengthIndicator(QR_MODE_AN,  $this->input->getVersion());
                      $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion());
          
          
          Severity: Minor
          Found in system/lib/phpqrcode/phpqrcode.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 evaluateSymbol has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public function evaluateSymbol($width, $frame)
                  {
                      $head = 0;
                      $demerit = 0;
          
          
          Severity: Major
          Found in system/lib/phpqrcode/phpqrcode.php - About 2 hrs to fix

            Method encodeMask has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public function encodeMask(QRinput $input, $mask)
                    {
                        if($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) {
                            throw new Exception('wrong version');
                        }
            Severity: Major
            Found in system/lib/phpqrcode/phpqrcode.php - About 2 hrs to fix

              Method createFrame has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public static function createFrame($version)
                      {
                          $width = self::$capacity[$version][QRCAP_WIDTH];
                          $frameLine = str_repeat ("\0", $width);
                          $frame = array_fill(0, $width, $frameLine);
              Severity: Minor
              Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

                Function splitString has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                        public function splitString()
                        {
                            while (strlen($this->dataStr) > 0)
                            {
                                if($this->dataStr == '')
                Severity: Minor
                Found in system/lib/phpqrcode/phpqrcode.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

                Function makeMaskNo has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                        public function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly = false) 
                        {
                            $b = 0;
                            $bitMask = array();
                            
                Severity: Minor
                Found in system/lib/phpqrcode/phpqrcode.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 eat8 has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public function eat8()
                        {
                            $la = QRspec::lengthIndicator(QR_MODE_AN, $this->input->getVersion());
                            $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion());
                
                
                Severity: Minor
                Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

                  Function createFrame has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                          public static function createFrame($version)
                          {
                              $width = self::$capacity[$version][QRCAP_WIDTH];
                              $frameLine = str_repeat ("\0", $width);
                              $frame = array_fill(0, $width, $frameLine);
                  Severity: Minor
                  Found in system/lib/phpqrcode/phpqrcode.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

                  Function lengthOfCode has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                          public static function lengthOfCode($mode, $version, $bits)
                          {
                              $payload = $bits - 4 - QRspec::lengthIndicator($mode, $version);
                              switch($mode) {
                                  case QR_MODE_NUM:
                  Severity: Minor
                  Found in system/lib/phpqrcode/phpqrcode.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

                  Function writeFormatInformation has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                          public function writeFormatInformation($width, &$frame, $mask, $level)
                          {
                              $blacks = 0;
                              $format =  QRspec::getFormatInfo($mask, $level);
                  
                  
                  Severity: Minor
                  Found in system/lib/phpqrcode/phpqrcode.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

                  Function encodeMask has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                          public function encodeMask(QRinput $input, $mask)
                          {
                              if($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) {
                                  throw new Exception('wrong version');
                              }
                  Severity: Minor
                  Found in system/lib/phpqrcode/phpqrcode.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 debug has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public static function debug($frame, $binary_mode = false)
                          {
                              if ($binary_mode) {
                              
                                      foreach ($frame as &$frameLine) {
                  Severity: Minor
                  Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

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

                            public function next()
                            {
                                do {
                                
                                    if($this->bit == -1) {
                    Severity: Minor
                    Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

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

                              public static function lengthOfCode($mode, $version, $bits)
                              {
                                  $payload = $bits - 4 - QRspec::lengthIndicator($mode, $version);
                                  switch($mode) {
                                      case QR_MODE_NUM:
                      Severity: Minor
                      Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

                        Function convertData has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                                public function convertData()
                                {
                                    $ver = $this->estimateVersion();
                                    if($ver > $this->getVersion()) {
                                        $this->setVersion($ver);
                        Severity: Minor
                        Found in system/lib/phpqrcode/phpqrcode.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

                        Function encodeBitStream has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                                public function encodeBitStream($version)
                                {
                                    try {
                                    
                                        unset($this->bstream);
                        Severity: Minor
                        Found in system/lib/phpqrcode/phpqrcode.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 eatAn has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public function eatAn()
                                {
                                    $la = QRspec::lengthIndicator(QR_MODE_AN,  $this->input->getVersion());
                                    $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion());
                        
                        
                        Severity: Minor
                        Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

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

                                  public function writeFormatInformation($width, &$frame, $mask, $level)
                                  {
                                      $blacks = 0;
                                      $format =  QRspec::getFormatInfo($mask, $level);
                          
                          
                          Severity: Minor
                          Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

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

                                    public static function newFrame($version)
                                    {
                                        if($version < 1 || $version > QRSPEC_VERSION_MAX) 
                                            return null;
                            
                            
                            Severity: Minor
                            Found in system/lib/phpqrcode/phpqrcode.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 encodeBitStream has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public function encodeBitStream($version)
                                    {
                                        try {
                                        
                                            unset($this->bstream);
                            Severity: Minor
                            Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

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

                                      public function mask($width, $frame, $level)
                                      {
                                          $minDemerit = PHP_INT_MAX;
                                          $bestMaskNum = 0;
                                          $bestMask = array();
                              Severity: Minor
                              Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

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

                                        public function init(array $spec)
                                        {
                                            $dl = QRspec::rsDataCodes1($spec);
                                            $el = QRspec::rsEccCodes1($spec);
                                            $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);
                                Severity: Minor
                                Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

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

                                          public static function putAlignmentPattern($version, &$frame, $width)
                                          {
                                              if($version < 2)
                                                  return;
                                  
                                  
                                  Severity: Minor
                                  Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

                                    Method factory has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            public static function factory($level = QR_ECLEVEL_L, $size = 3, $margin = 4)
                                            {
                                                $enc = new QRencode();
                                                $enc->size = $size;
                                                $enc->margin = $margin;
                                    Severity: Minor
                                    Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

                                      Method encode_rs_char has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              public function encode_rs_char($data, &$parity)
                                              {
                                                  $MM       =& $this->mm;
                                                  $NN       =& $this->nn;
                                                  $ALPHA_TO =& $this->alpha_to;
                                      Severity: Minor
                                      Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

                                        Method makeMaskNo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                public function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly = false) 
                                                {
                                                    $b = 0;
                                                    $bitMask = array();
                                                    
                                        Severity: Minor
                                        Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

                                          Method eatNum has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                                  public function eatNum()
                                                  {
                                                      $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion());
                                          
                                                      $p = 0;
                                          Severity: Minor
                                          Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

                                            Method appendPaddingBit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                    public function appendPaddingBit(&$bstream)
                                                    {
                                                        $bits = $bstream->size();
                                                        $maxwords = QRspec::getDataLength($this->version, $this->level);
                                                        $maxbits = $maxwords * 8;
                                            Severity: Minor
                                            Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

                                              Method toByte has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                      public function toByte()
                                                      {
                                                      
                                                          $size = $this->size();
                                              
                                              
                                              Severity: Minor
                                              Found in system/lib/phpqrcode/phpqrcode.php - About 1 hr to fix

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

                                                        public function encode_rs_char($data, &$parity)
                                                        {
                                                            $MM       =& $this->mm;
                                                            $NN       =& $this->nn;
                                                            $ALPHA_TO =& $this->alpha_to;
                                                Severity: Minor
                                                Found in system/lib/phpqrcode/phpqrcode.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 putAlignmentPattern has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                        public static function putAlignmentPattern($version, &$frame, $width)
                                                        {
                                                            if($version < 2)
                                                                return;
                                                
                                                
                                                Severity: Minor
                                                Found in system/lib/phpqrcode/phpqrcode.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

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

                                                        public function toUpper()
                                                        {
                                                            $stringLen = strlen($this->dataStr);
                                                            $p = 0;
                                                            
                                                Severity: Minor
                                                Found in system/lib/phpqrcode/phpqrcode.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

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

                                                        public static function check($mode, $size, $data)
                                                        {
                                                            if($size <= 0) 
                                                                return false;
                                                
                                                
                                                Severity: Minor
                                                Found in system/lib/phpqrcode/phpqrcode.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

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

                                                        public function appendPaddingBit(&$bstream)
                                                        {
                                                            $bits = $bstream->size();
                                                            $maxwords = QRspec::getDataLength($this->version, $this->level);
                                                            $maxbits = $maxwords * 8;
                                                Severity: Minor
                                                Found in system/lib/phpqrcode/phpqrcode.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 init_rs_char has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                        public static function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
                                                Severity: Minor
                                                Found in system/lib/phpqrcode/phpqrcode.php - About 45 mins to fix

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

                                                          public static function png($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false) 
                                                  Severity: Minor
                                                  Found in system/lib/phpqrcode/phpqrcode.php - About 45 mins to fix

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

                                                            public function eatNum()
                                                            {
                                                                $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion());
                                                    
                                                                $p = 0;
                                                    Severity: Minor
                                                    Found in system/lib/phpqrcode/phpqrcode.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 init_rs has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                            public static function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
                                                    Severity: Minor
                                                    Found in system/lib/phpqrcode/phpqrcode.php - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                                  } else if((($i+3) >= $length) || ($this->runLength[$i+3] >= (4 * $fact))) {
                                                                                      $demerit += N3;
                                                                                  }
                                                      Severity: Major
                                                      Found in system/lib/phpqrcode/phpqrcode.php - About 45 mins to fix

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

                                                                public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE) 
                                                        Severity: Minor
                                                        Found in system/lib/phpqrcode/phpqrcode.php - About 35 mins to fix

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

                                                                  public static function jpg($frame, $filename = false, $pixelPerPoint = 8, $outerFrame = 4, $q = 85) 
                                                          Severity: Minor
                                                          Found in system/lib/phpqrcode/phpqrcode.php - About 35 mins to fix

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

                                                                    public function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly = false) 
                                                            Severity: Minor
                                                            Found in system/lib/phpqrcode/phpqrcode.php - About 35 mins to fix

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

                                                                      public static function text($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) 
                                                              Severity: Minor
                                                              Found in system/lib/phpqrcode/phpqrcode.php - About 35 mins to fix

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

                                                                        public static function raw($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) 
                                                                Severity: Minor
                                                                Found in system/lib/phpqrcode/phpqrcode.php - About 35 mins to fix

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

                                                                          public function __construct($dl, $data, $el, &$ecc, QRrsItem $rs)
                                                                  Severity: Minor
                                                                  Found in system/lib/phpqrcode/phpqrcode.php - About 35 mins to fix

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

                                                                            public static function set(&$srctab, $x, $y, $repl, $replLen = false) {
                                                                    Severity: Minor
                                                                    Found in system/lib/phpqrcode/phpqrcode.php - About 35 mins to fix

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

                                                                              public function encodeString($string, $version, $level, $hint, $casesensitive)
                                                                      Severity: Minor
                                                                      Found in system/lib/phpqrcode/phpqrcode.php - About 35 mins to fix

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

                                                                                public function toByte()
                                                                                {
                                                                                
                                                                                    $size = $this->size();
                                                                        
                                                                        
                                                                        Severity: Minor
                                                                        Found in system/lib/phpqrcode/phpqrcode.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 generateMaskNo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                        Open

                                                                                private function generateMaskNo($maskNo, $width, $frame)
                                                                                {
                                                                                    $bitMask = array_fill(0, $width, array_fill(0, $width, 0));
                                                                                    
                                                                                    for($y=0; $y<$width; $y++) {
                                                                        Severity: Minor
                                                                        Found in system/lib/phpqrcode/phpqrcode.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 maximumWords has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                        Open

                                                                                public static function maximumWords($mode, $version)
                                                                                {
                                                                                    if($mode == QR_MODE_STRUCTURE) 
                                                                                        return 3;
                                                                                        
                                                                        Severity: Minor
                                                                        Found in system/lib/phpqrcode/phpqrcode.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 checkModeKanji has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                        Open

                                                                                public static function checkModeKanji($size, $data)
                                                                                {
                                                                                    if($size & 1)
                                                                                        return false;
                                                                        
                                                                        
                                                                        Severity: Minor
                                                                        Found in system/lib/phpqrcode/phpqrcode.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 newFromBytes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                        Open

                                                                                public static function newFromBytes($size, $data)
                                                                                {
                                                                                    $bstream = new QRbitstream();
                                                                                    $bstream->allocate($size * 8);
                                                                                    $p=0;
                                                                        Severity: Minor
                                                                        Found in system/lib/phpqrcode/phpqrcode.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 log has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                        Open

                                                                                public static function log($outfile, $err)
                                                                                {
                                                                                    if (QR_LOG_DIR !== false) {
                                                                                        if ($err != '') {
                                                                                            if ($outfile !== false) {
                                                                        Severity: Minor
                                                                        Found in system/lib/phpqrcode/phpqrcode.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 getCode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                        Open

                                                                                public function getCode()
                                                                                {
                                                                                    $ret;
                                                                        
                                                                                    if($this->count < $this->dataLength) {
                                                                        Severity: Minor
                                                                        Found in system/lib/phpqrcode/phpqrcode.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

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                    return QR_MODE_8;
                                                                        Severity: Major
                                                                        Found in system/lib/phpqrcode/phpqrcode.php - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                      return $ret;
                                                                          Severity: Major
                                                                          Found in system/lib/phpqrcode/phpqrcode.php - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                            case QR_MODE_STRUCTURE: return true; break;
                                                                            Severity: Major
                                                                            Found in system/lib/phpqrcode/phpqrcode.php - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                          return $rs;
                                                                              Severity: Major
                                                                              Found in system/lib/phpqrcode/phpqrcode.php - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                                case QR_MODE_8:         return true; break;
                                                                                Severity: Major
                                                                                Found in system/lib/phpqrcode/phpqrcode.php - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                              return false;
                                                                                  Severity: Major
                                                                                  Found in system/lib/phpqrcode/phpqrcode.php - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                                if($pad < 0 || $pad >= ((1<<$symsize) -1 - $nroots)) return $rs; // Too much padding
                                                                                    Severity: Major
                                                                                    Found in system/lib/phpqrcode/phpqrcode.php - About 30 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                                      return $rs;
                                                                                      Severity: Major
                                                                                      Found in system/lib/phpqrcode/phpqrcode.php - About 30 mins to fix

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

                                                                                                public static function lengthIndicator($mode, $version)
                                                                                                {
                                                                                                    if ($mode == QR_MODE_STRUCTURE)
                                                                                                        return 0;
                                                                                                        
                                                                                        Severity: Minor
                                                                                        Found in system/lib/phpqrcode/phpqrcode.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 estimateBitStreamSizeOfEntry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                                public function estimateBitStreamSizeOfEntry($version)
                                                                                                {
                                                                                                    $bits = 0;
                                                                                        
                                                                                                    if($version == 0) 
                                                                                        Severity: Minor
                                                                                        Found in system/lib/phpqrcode/phpqrcode.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 calcParity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                                public function calcParity()
                                                                                                {
                                                                                                    $parity = 0;
                                                                                                    
                                                                                                    foreach($this->items as $item) {
                                                                                        Severity: Minor
                                                                                        Found in system/lib/phpqrcode/phpqrcode.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 debug has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                                public static function debug($frame, $binary_mode = false)
                                                                                                {
                                                                                                    if ($binary_mode) {
                                                                                                    
                                                                                                            foreach ($frame as &$frameLine) {
                                                                                        Severity: Minor
                                                                                        Found in system/lib/phpqrcode/phpqrcode.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 image has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                                private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4) 
                                                                                                {
                                                                                                    $h = count($frame);
                                                                                                    $w = strlen($frame[0]);
                                                                                                    
                                                                                        Severity: Minor
                                                                                        Found in system/lib/phpqrcode/phpqrcode.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 encodeModeNum has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                                public function encodeModeNum($version)
                                                                                                {
                                                                                                    try {
                                                                                                    
                                                                                                        $words = (int)($this->size / 3);
                                                                                        Severity: Minor
                                                                                        Found in system/lib/phpqrcode/phpqrcode.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 mask has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                                public function mask($width, $frame, $level)
                                                                                                {
                                                                                                    $minDemerit = PHP_INT_MAX;
                                                                                                    $bestMaskNum = 0;
                                                                                                    $bestMask = array();
                                                                                        Severity: Minor
                                                                                        Found in system/lib/phpqrcode/phpqrcode.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 factory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                                public static function factory($level = QR_ECLEVEL_L, $size = 3, $margin = 4)
                                                                                                {
                                                                                                    $enc = new QRencode();
                                                                                                    $enc->size = $size;
                                                                                                    $enc->margin = $margin;
                                                                                        Severity: Minor
                                                                                        Found in system/lib/phpqrcode/phpqrcode.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 2 locations. Consider refactoring.
                                                                                        Open

                                                                                            class QRspec {
                                                                                            
                                                                                                public static $capacity = array(
                                                                                                    array(  0,    0, 0, array(   0,    0,    0,    0)),
                                                                                                    array( 21,   26, 0, array(   7,   10,   13,   17)), // 1
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 1 mo to fix
                                                                                        system/lib/phpqrcode/qrspec.php on lines 42..592

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

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                            class QRmask {
                                                                                            
                                                                                                public $runLength = array();
                                                                                                
                                                                                                //----------------------------------------------------------------------
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 2 wks to fix
                                                                                        system/lib/phpqrcode/qrmask.php on lines 33..328

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

                                                                                        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

                                                                                            class QRinput {
                                                                                        
                                                                                                public $items;
                                                                                                
                                                                                                private $version;
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 2 wks to fix
                                                                                        system/lib/phpqrcode/qrinput.php on lines 274..726

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

                                                                                        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

                                                                                            class QRsplit {
                                                                                        
                                                                                                public $dataStr = '';
                                                                                                public $input;
                                                                                                public $modeHint;
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 1 wk to fix
                                                                                        system/lib/phpqrcode/qrsplit.php on lines 33..311

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

                                                                                        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

                                                                                            class QRinputItem {
                                                                                            
                                                                                                public $mode;
                                                                                                public $size;
                                                                                                public $data;
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 1 wk to fix
                                                                                        system/lib/phpqrcode/qrinput.php on lines 31..270

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

                                                                                        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

                                                                                            class QRrsItem {
                                                                                            
                                                                                                public $mm;                  // Bits per symbol 
                                                                                                public $nn;                  // Symbols per block (= (1<<mm)-1) 
                                                                                                public $alpha_to = array();  // log lookup table 
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 6 days to fix
                                                                                        system/lib/phpqrcode/qrrscode.php on lines 31..183

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

                                                                                        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

                                                                                            class QRcode {
                                                                                            
                                                                                                public $version;
                                                                                                public $width;
                                                                                                public $data; 
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 6 days to fix
                                                                                        system/lib/phpqrcode/qrencode.php on lines 156..302

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

                                                                                        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

                                                                                            class QRtools {
                                                                                            
                                                                                                //----------------------------------------------------------------------
                                                                                                public static function binarize($frame)
                                                                                                {
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 5 days to fix
                                                                                        system/lib/phpqrcode/qrtools.php on lines 25..167

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

                                                                                        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

                                                                                            class QRrawcode {
                                                                                                public $version;
                                                                                                public $datacode = array();
                                                                                                public $ecccode = array();
                                                                                                public $blocks;
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 5 days to fix
                                                                                        system/lib/phpqrcode/qrencode.php on lines 47..152

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

                                                                                        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

                                                                                            class QRbitstream {
                                                                                            
                                                                                                public $data = array();
                                                                                                
                                                                                                //----------------------------------------------------------------------
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 4 days to fix
                                                                                        system/lib/phpqrcode/qrbitstream.php on lines 28..180

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

                                                                                        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

                                                                                            class QRencode {
                                                                                            
                                                                                                public $casesensitive = true;
                                                                                                public $eightbit = false;
                                                                                                
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 3 days to fix
                                                                                        system/lib/phpqrcode/qrencode.php on lines 396..502

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

                                                                                        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

                                                                                            class QRimage {
                                                                                            
                                                                                                //----------------------------------------------------------------------
                                                                                                public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE) 
                                                                                                {
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 3 days to fix
                                                                                        system/lib/phpqrcode/qrimage.php on lines 27..95

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

                                                                                        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

                                                                                            class FrameFiller {
                                                                                            
                                                                                                public $width;
                                                                                                public $frame;
                                                                                                public $x;
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 2 days to fix
                                                                                        system/lib/phpqrcode/qrencode.php on lines 306..392

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

                                                                                        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

                                                                                            class QRrs {
                                                                                            
                                                                                                public static $items = array();
                                                                                                
                                                                                                //----------------------------------------------------------------------
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 4 hrs to fix
                                                                                        system/lib/phpqrcode/qrrscode.php on lines 187..210

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

                                                                                        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

                                                                                            class qrstr {
                                                                                                public static function set(&$srctab, $x, $y, $repl, $replLen = false) {
                                                                                                    $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl));
                                                                                                }
                                                                                            }    
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 1 hr to fix
                                                                                        system/lib/phpqrcode/qrconst.php on lines 50..54

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

                                                                                        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

                                                                                            class QRrsblock {
                                                                                                public $dataLength;
                                                                                                public $data = array();
                                                                                                public $eccLength;
                                                                                                public $ecc = array();
                                                                                        Severity: Major
                                                                                        Found in system/lib/phpqrcode/phpqrcode.php and 1 other location - About 1 hr to fix
                                                                                        system/lib/phpqrcode/qrencode.php on lines 28..43

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

                                                                                        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