arastta/arastta

View on GitHub
system/mpdf/classes/cssmgr.php

Summary

Maintainability
F
3 mos
Test Coverage

Function fixCSS has a Cognitive Complexity of 1642 (exceeds 5 allowed). Consider refactoring.
Open

function fixCSS($prop) {
    if (!is_array($prop) || (count($prop)==0)) return array(); 
    $newprop = array(); 
    foreach($prop AS $k => $v) {
        if ($k != 'BACKGROUND-IMAGE' && $k != 'BACKGROUND' && $k != 'ODD-HEADER-NAME' && $k != 'EVEN-HEADER-NAME' && $k != 'ODD-FOOTER-NAME' && $k != 'EVEN-FOOTER-NAME' && $k != 'HEADER' && $k != 'FOOTER') {
Severity: Minor
Found in system/mpdf/classes/cssmgr.php - About 1 mo 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 ReadCSS has a Cognitive Complexity of 522 (exceeds 5 allowed). Consider refactoring.
Open

function ReadCSS($html) {
    preg_match_all('/<style[^>]*media=["\']([^"\'>]*)["\'].*?<\/style>/is',$html,$m);
    for($i=0; $i<count($m[0]); $i++) {
        if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) { 
            $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
Severity: Minor
Found in system/mpdf/classes/cssmgr.php - About 1 wk 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 MergeCSS has a Cognitive Complexity of 445 (exceeds 5 allowed). Consider refactoring.
Open

function MergeCSS($inherit,$tag,$attr) {
    $p = array();
    $zp = array(); 

    $classes = array();
Severity: Minor
Found in system/mpdf/classes/cssmgr.php - About 1 wk 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

File cssmgr.php has 1435 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

class cssmgr {

var $mpdf = null;
Severity: Major
Found in system/mpdf/classes/cssmgr.php - About 3 days to fix

    Function inlinePropsToCSS has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
    Open

    function inlinePropsToCSS($bilp, &$p) {
        if (isset($bilp[ 'family' ]) && $bilp[ 'family' ]) { $p['FONT-FAMILY'] = $bilp[ 'family' ]; }
        if (isset($bilp[ 'I' ]) && $bilp[ 'I' ]) { $p['FONT-STYLE'] = 'italic'; }
        if (isset($bilp[ 'sizePt' ]) && $bilp[ 'sizePt' ]) { $p['FONT-SIZE'] = $bilp[ 'sizePt' ] . 'pt'; }
        if (isset($bilp[ 'B' ]) && $bilp[ 'B' ]) { $p['FONT-WEIGHT'] = 'bold'; }
    Severity: Minor
    Found in system/mpdf/classes/cssmgr.php - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method fixCSS has 318 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function fixCSS($prop) {
        if (!is_array($prop) || (count($prop)==0)) return array(); 
        $newprop = array(); 
        foreach($prop AS $k => $v) {
            if ($k != 'BACKGROUND-IMAGE' && $k != 'BACKGROUND' && $k != 'ODD-HEADER-NAME' && $k != 'EVEN-HEADER-NAME' && $k != 'ODD-FOOTER-NAME' && $k != 'EVEN-FOOTER-NAME' && $k != 'HEADER' && $k != 'FOOTER') {
    Severity: Major
    Found in system/mpdf/classes/cssmgr.php - About 1 day to fix

      Method MergeCSS has 312 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function MergeCSS($inherit,$tag,$attr) {
          $p = array();
          $zp = array(); 
      
          $classes = array();
      Severity: Major
      Found in system/mpdf/classes/cssmgr.php - About 1 day to fix

        Method ReadCSS has 253 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ReadCSS($html) {
            preg_match_all('/<style[^>]*media=["\']([^"\'>]*)["\'].*?<\/style>/is',$html,$m);
            for($i=0; $i<count($m[0]); $i++) {
                if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) { 
                    $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
        Severity: Major
        Found in system/mpdf/classes/cssmgr.php - About 1 day to fix

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

          function _nthchild($f, $c) {
              // $f is formual e.g. 2N+1 spilt into a preg_match array
              // $c is the comparator value e.g row or column number
              $c += 1;
              $select = false;
          Severity: Minor
          Found in system/mpdf/classes/cssmgr.php - About 1 day to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function border_radius_expand has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
          Open

          function border_radius_expand($val,$k) {
              $b = array();
              if ($k == 'BORDER-RADIUS') {
                  $hv = explode('/',trim($val));
                  $prop = preg_split('/\s+/',trim($hv[0]));
          Severity: Minor
          Found in system/mpdf/classes/cssmgr.php - About 1 day to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function parseCSSbackground has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
          Open

          function parseCSSbackground($s) {
              $bg = array('c'=>false, 'i'=>false, 'r'=>false, 'p'=>false, );
          /*-- BACKGROUNDS --*/
              if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient\(.*\)/i',$s,$m)) {
                  $bg['i'] = $m[0];
          Severity: Minor
          Found in system/mpdf/classes/cssmgr.php - About 1 day to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function _mergeFullCSS has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
          Open

          function _mergeFullCSS($p, &$t, $tag, $classes, $id, $lang) {    // mPDF 6
                  if (isset($p[$tag])) { $this->_mergeCSS($p[$tag], $t); }
                  // STYLESHEET CLASS e.g. .smallone{}  .redletter{}
                  foreach($classes AS $class) {
                      if (isset($p['CLASS>>'.$class])) { $this->_mergeCSS($p['CLASS>>'.$class], $t); }
          Severity: Minor
          Found in system/mpdf/classes/cssmgr.php - About 1 day to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function _mergeBorders has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
          Open

          function _mergeBorders(&$b, &$a) {    // Merges $a['BORDER-TOP-STYLE'] to $b['BORDER-TOP'] etc.
            foreach(array('TOP','RIGHT','BOTTOM','LEFT') AS $side) {
              foreach(array('STYLE','WIDTH','COLOR') AS $el) {
              if (isset($a['BORDER-'.$side.'-'.$el])) {    // e.g. $b['BORDER-TOP-STYLE']
                  $s = trim($a['BORDER-'.$side.'-'.$el]);
          Severity: Minor
          Found in system/mpdf/classes/cssmgr.php - About 7 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 _fix_borderStr has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
          Open

          function _fix_borderStr($bd) {
              preg_match_all("/\((.*?)\)/", $bd, $m);
              if (count($m[1])) { 
                  for($i=0;$i<count($m[1]);$i++) {
                      $sub = preg_replace("/ /", "", $m[1][$i]);
          Severity: Minor
          Found in system/mpdf/classes/cssmgr.php - About 7 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 PreviewBlockCSS has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

          function PreviewBlockCSS($tag,$attr) {
              // Looks ahead from current block level to a new level
              $p = array();
              $zp = array(); 
              $oldcascadeCSS = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'];
          Severity: Minor
          Found in system/mpdf/classes/cssmgr.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 setCSSboxshadow has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          function setCSSboxshadow($v) {
              $sh = array();
              $c = preg_match_all('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl)\(.*?\)/',$v,$x);    // mPDF 5.6.05
              for($i=0; $i<$c; $i++) {
                  $col = preg_replace('/,/','*',$x[0][$i]);
          Severity: Minor
          Found in system/mpdf/classes/cssmgr.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

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

          function border_radius_expand($val,$k) {
              $b = array();
              if ($k == 'BORDER-RADIUS') {
                  $hv = explode('/',trim($val));
                  $prop = preg_split('/\s+/',trim($hv[0]));
          Severity: Major
          Found in system/mpdf/classes/cssmgr.php - About 2 hrs to fix

            Function setCSStextshadow has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            function setCSStextshadow($v) {
                $sh = array();
                $c = preg_match_all('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl)\(.*?\)/',$v,$x);    // mPDF 5.6.05
                for($i=0; $i<$c; $i++) {
                    $col = preg_replace('/,/','*',$x[0][$i]);
            Severity: Minor
            Found in system/mpdf/classes/cssmgr.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 inlinePropsToCSS has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function inlinePropsToCSS($bilp, &$p) {
                if (isset($bilp[ 'family' ]) && $bilp[ 'family' ]) { $p['FONT-FAMILY'] = $bilp[ 'family' ]; }
                if (isset($bilp[ 'I' ]) && $bilp[ 'I' ]) { $p['FONT-STYLE'] = 'italic'; }
                if (isset($bilp[ 'sizePt' ]) && $bilp[ 'sizePt' ]) { $p['FONT-SIZE'] = $bilp[ 'sizePt' ] . 'pt'; }
                if (isset($bilp[ 'B' ]) && $bilp[ 'B' ]) { $p['FONT-WEIGHT'] = 'bold'; }
            Severity: Major
            Found in system/mpdf/classes/cssmgr.php - About 2 hrs to fix

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

              function PreviewBlockCSS($tag,$attr) {
                  // Looks ahead from current block level to a new level
                  $p = array();
                  $zp = array(); 
                  $oldcascadeCSS = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'];
              Severity: Minor
              Found in system/mpdf/classes/cssmgr.php - About 1 hr to fix

                Method _mergeFullCSS has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function _mergeFullCSS($p, &$t, $tag, $classes, $id, $lang) {    // mPDF 6
                        if (isset($p[$tag])) { $this->_mergeCSS($p[$tag], $t); }
                        // STYLESHEET CLASS e.g. .smallone{}  .redletter{}
                        foreach($classes AS $class) {
                            if (isset($p['CLASS>>'.$class])) { $this->_mergeCSS($p['CLASS>>'.$class], $t); }
                Severity: Minor
                Found in system/mpdf/classes/cssmgr.php - About 1 hr to fix

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

                  function readInlineCSS($html) {
                      $html=htmlspecialchars_decode($html);    // mPDF 5.7.4 URLs
                      // mPDF 5.7.4 URLs
                      // Characters "(" ")" and ";" in url() e.g. background-image, cause probems parsing the CSS string
                      // URLencode ( and ), but change ";" to a code which can be converted back after parsing (so as not to confuse ; 
                  Severity: Minor
                  Found in system/mpdf/classes/cssmgr.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 parseCSSbackground has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function parseCSSbackground($s) {
                      $bg = array('c'=>false, 'i'=>false, 'r'=>false, 'p'=>false, );
                  /*-- BACKGROUNDS --*/
                      if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient\(.*\)/i',$s,$m)) {
                          $bg['i'] = $m[0];
                  Severity: Minor
                  Found in system/mpdf/classes/cssmgr.php - About 1 hr to fix

                    Function array_merge_recursive_unique has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function array_merge_recursive_unique($array1, $array2) {
                        $arrays = func_get_args();
                        $narrays = count($arrays);
                        $ret = $arrays[0];
                        for ($i = 1; $i < $narrays; $i ++) {
                    Severity: Minor
                    Found in system/mpdf/classes/cssmgr.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 readInlineCSS has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function readInlineCSS($html) {
                        $html=htmlspecialchars_decode($html);    // mPDF 5.7.4 URLs
                        // mPDF 5.7.4 URLs
                        // Characters "(" ")" and ";" in url() e.g. background-image, cause probems parsing the CSS string
                        // URLencode ( and ), but change ";" to a code which can be converted back after parsing (so as not to confuse ; 
                    Severity: Minor
                    Found in system/mpdf/classes/cssmgr.php - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if ($k != 'BACKGROUND-IMAGE' && $k != 'BACKGROUND' && $k != 'ODD-HEADER-NAME' && $k != 'EVEN-HEADER-NAME' && $k != 'ODD-FOOTER-NAME' && $k != 'EVEN-FOOTER-NAME' && $k != 'HEADER' && $k != 'FOOTER') {
                                  $v = strtolower($v);
                              }
                      Severity: Critical
                      Found in system/mpdf/classes/cssmgr.php - About 1 hr to fix

                        Method _fix_borderStr has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function _fix_borderStr($bd) {
                            preg_match_all("/\((.*?)\)/", $bd, $m);
                            if (count($m[1])) { 
                                for($i=0;$i<count($m[1]);$i++) {
                                    $sub = preg_replace("/ /", "", $m[1][$i]);
                        Severity: Minor
                        Found in system/mpdf/classes/cssmgr.php - About 1 hr to fix

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

                          function _set_mergedCSS(&$m, &$p, $d=true, $bd=false) {
                              if (isset($m)) {
                                  if ((isset($m['depth']) && $m['depth']>1) || $d==false) {     // include check for 'depth'
                                      if ($bd) { $this->setBorderDominance($m, $bd); }    // *TABLES*
                                      if (is_array($m)) { 
                          Severity: Minor
                          Found in system/mpdf/classes/cssmgr.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 _nthchild has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function _nthchild($f, $c) {
                              // $f is formual e.g. 2N+1 spilt into a preg_match array
                              // $c is the comparator value e.g row or column number
                              $c += 1;
                              $select = false;
                          Severity: Minor
                          Found in system/mpdf/classes/cssmgr.php - About 1 hr to fix

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

                            function setCSSboxshadow($v) {
                                $sh = array();
                                $c = preg_match_all('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl)\(.*?\)/',$v,$x);    // mPDF 5.6.05
                                for($i=0; $i<$c; $i++) {
                                    $col = preg_replace('/,/','*',$x[0][$i]);
                            Severity: Minor
                            Found in system/mpdf/classes/cssmgr.php - About 1 hr to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          else if (preg_match('/^('.$this->mpdf->allowedCSStags.')$/',$t)) { $tag= $t; }
                              Severity: Major
                              Found in system/mpdf/classes/cssmgr.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        else if (!$this->mpdf->tablethead) { $row -= ($thnr + $tfnr); }
                                Severity: Major
                                Found in system/mpdf/classes/cssmgr.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if (!preg_match('/^data:image/i', $embedded)) {    // mPDF 5.5.13
                                                          $this->mpdf->GetFullPath($embedded, $cssBasePath );
                                                          $CSSextblock = preg_replace('/'.preg_quote($cxtem[0][$i],'/').'/', ($cxtem[1][$i].$embedded.$cxtem[3][$i]), $CSSextblock);
                                                      }
                                  Severity: Major
                                  Found in system/mpdf/classes/cssmgr.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if ($select) {
                                                            $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag.'>>SELECTORNTHCHILD>>'.$m[1]], $p, false, 9);
                                                        }
                                    Severity: Major
                                    Found in system/mpdf/classes/cssmgr.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          else if ($tag=='TD' || $tag=='TH')  {
                                                              if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/',$m[1],$a)) {    // mPDF 5.7.4
                                                                  $select = $this->_nthchild($a, $this->mpdf->col);
                                                              }
                                                          }
                                      Severity: Major
                                      Found in system/mpdf/classes/cssmgr.php - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/',$m[1],$a)) {    // mPDF 5.7.4
                                                                    $select = $this->_nthchild($a, $row);
                                                                }
                                        Severity: Major
                                        Found in system/mpdf/classes/cssmgr.php - About 45 mins to fix

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

                                          function _mergeFullCSS($p, &$t, $tag, $classes, $id, $lang) {    // mPDF 6
                                          Severity: Minor
                                          Found in system/mpdf/classes/cssmgr.php - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                    if ((strtoupper($property)=='BACKGROUND-IMAGE' || strtoupper($property)=='BACKGROUND') && preg_match('/-webkit-gradient/i',$value)) { 
                                                                        continue; 
                                                                    }
                                            Severity: Major
                                            Found in system/mpdf/classes/cssmgr.php - About 45 mins to fix

                                              Consider simplifying this complex logical expression.
                                              Open

                                                              if ((!$this->mpdf->onlyCoreFonts && in_array($v,$this->mpdf->available_unifonts)) || 
                                                                  in_array($v,array('ccourier','ctimes','chelvetica')) ||
                                                                  ($this->mpdf->onlyCoreFonts && in_array($v,array('courier','times','helvetica','arial'))) || 
                                                                  in_array($v, array('sjis','uhc','big5','gb'))) { 
                                                                  $newprop[$k] = $v; 
                                              Severity: Major
                                              Found in system/mpdf/classes/cssmgr.php - About 40 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                    return array(); 
                                                Severity: Major
                                                Found in system/mpdf/classes/cssmgr.php - About 30 mins to fix

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

                                                                              if (preg_match('/^[.](.*)$/',$t,$m)) { $tag = 'CLASS>>'.$m[1]; }
                                                                              else if (preg_match('/^[#](.*)$/',$t,$m)) { $tag = 'ID>>'.$m[1]; }
                                                                              else if (preg_match('/^\[LANG=[\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\]$/',$t,$m)) { $tag = 'LANG>>'.strtolower($m[1]); }    // mPDF 6  Special case for lang as attribute selector
                                                                              else if (preg_match('/^:LANG\([\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\)$/',$t,$m)) { $tag = 'LANG>>'.strtolower($m[1]); }    // mPDF 6  Special case for lang as attribute selector
                                                                              else if (preg_match('/^('.$this->mpdf->allowedCSStags.')[.](.*)$/',$t,$m)) { $tag = $m[1].'>>CLASS>>'.$m[2]; }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 2 days to fix
                                                  system/mpdf/classes/cssmgr.php on lines 275..284

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                          if (preg_match('/^[.](.*)$/',$t,$m)) { $tag = 'CLASS>>'.$m[1]; }
                                                                          else if (preg_match('/^[#](.*)$/',$t,$m)) { $tag = 'ID>>'.$m[1]; }
                                                                          else if (preg_match('/^\[LANG=[\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\]$/',$t,$m)) { $tag = 'LANG>>'.strtolower($m[1]); }    // mPDF 6  Special case for lang as attribute selector
                                                                          else if (preg_match('/^:LANG\([\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\)$/',$t,$m)) { $tag = 'LANG>>'.strtolower($m[1]); }    // mPDF 6  Special case for lang as attribute selector
                                                                          else if (preg_match('/^('.$this->mpdf->allowedCSStags.')[.](.*)$/',$t,$m)) { $tag = $m[1].'>>CLASS>>'.$m[2]; }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 2 days to fix
                                                  system/mpdf/classes/cssmgr.php on lines 296..305

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                      if (strpos($html,'url(')!==false) {
                                                          preg_match_all( '/url\(\"(.*?)\"\)/', $html, $m);
                                                          for($i = 0; $i < count($m[1]) ; $i++) {
                                                              $tmp = str_replace(array('(',')',';'),array('%28','%29',$tempmarker),$m[1][$i]);
                                                              $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/', 'url(\''.$tmp.'\')', $html);
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 2 days to fix
                                                  system/mpdf/classes/cssmgr.php on lines 191..207

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                      if (strpos($CSSstr,'url(')!==false) {
                                                          preg_match_all( '/url\(\"(.*?)\"\)/', $CSSstr, $m);
                                                          for($i = 0; $i < count($m[1]) ; $i++) {
                                                              $tmp = str_replace(array('(',')',';'),array('%28','%29',$tempmarker),$m[1][$i]);
                                                              $CSSstr = preg_replace('/'.preg_quote($m[0][$i],'/').'/', 'url(\''.$tmp.'\')', $CSSstr);
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 2 days to fix
                                                  system/mpdf/classes/cssmgr.php on lines 343..359

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                  if ($tag=='TR')  {
                                                                      $row = $this->mpdf->row;
                                                                      $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
                                                                      $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
                                                                      if ($this->mpdf->tabletfoot) { $row -= $thnr; }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 2 other locations - About 1 day to fix
                                                  system/mpdf/classes/cssmgr.php on lines 1037..1051
                                                  system/mpdf/classes/cssmgr.php on lines 1476..1490

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                      if ($tag=='TR')  {
                                                                          $row = $this->mpdf->row;
                                                                          $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
                                                                          $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
                                                                          if ($this->mpdf->tabletfoot) { $row -= $thnr; }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 2 other locations - About 1 day to fix
                                                  system/mpdf/classes/cssmgr.php on lines 1037..1051
                                                  system/mpdf/classes/cssmgr.php on lines 1338..1352

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                      if ($tag=='TR')  {
                                                                          $row = $this->mpdf->row;
                                                                          $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
                                                                          $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
                                                                          if ($this->mpdf->tabletfoot) { $row -= $thnr; }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 2 other locations - About 1 day to fix
                                                  system/mpdf/classes/cssmgr.php on lines 1338..1352
                                                  system/mpdf/classes/cssmgr.php on lines 1476..1490

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (count($prop)==1) {
                                                                  $b['TL-V'] = $b['TR-V'] = $b['BR-V'] = $b['BL-V'] = $prop[0];
                                                              }
                                                              else if (count($prop)==2) {
                                                                  $b['TL-V'] = $b['BR-V'] = $prop[0];
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 1 day to fix
                                                  system/mpdf/classes/cssmgr.php on lines 915..932

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                          if (count($prop)==1) {
                                                              $b['TL-H'] = $b['TR-H'] = $b['BR-H'] = $b['BL-H'] = $prop[0];
                                                          }
                                                          else if (count($prop)==2) {
                                                              $b['TL-H'] = $b['BR-H'] = $prop[0];
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 1 day to fix
                                                  system/mpdf/classes/cssmgr.php on lines 935..952

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (count($bits)==1) {
                                                                  if (preg_match('/bottom/',$bits[0])) { $bg['p'] = '50% 100%'; }
                                                                  else if (preg_match('/top/',$bits[0])) { $bg['p'] = '50% 0%'; }
                                                                  else { $bg['p'] = $bits[0] . ' 50%'; }
                                                              }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 6 hrs to fix
                                                  system/mpdf/classes/cssmgr.php on lines 690..703

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (count($bits)==1) {
                                                                  if (preg_match('/bottom/',$bits[0])) { $bg['p'] = '50% 100%'; }
                                                                  else if (preg_match('/top/',$bits[0])) { $bg['p'] = '50% 0%'; }
                                                                  else { $bg['p'] = $bits[0] . ' 50%'; }
                                                              }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 6 hrs to fix
                                                  system/mpdf/classes/cssmgr.php on lines 861..874

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if ($bg['p']) {
                                                                  $bg['p'] = preg_replace('/(left|top)/','0%',$bg['p']);
                                                                  $bg['p'] = preg_replace('/(right|bottom)/','100%',$bg['p']);
                                                                  $bg['p'] = preg_replace('/(center)/','50%',$bg['p']);
                                                                  if (!preg_match('/[\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)* [\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)*/',$bg['p'])) {
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 2 hrs to fix
                                                  system/mpdf/classes/cssmgr.php on lines 704..711

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if ($bg['p']) {
                                                                  $bg['p'] = preg_replace('/(left|top)/','0%',$bg['p']);
                                                                  $bg['p'] = preg_replace('/(right|bottom)/','100%',$bg['p']);
                                                                  $bg['p'] = preg_replace('/(center)/','50%',$bg['p']);
                                                                  if (!preg_match('/[\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)* [\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)*/',$bg['p'])) {
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 2 hrs to fix
                                                  system/mpdf/classes/cssmgr.php on lines 875..882

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

                                                  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

                                                      for($i=0; $i<count($m[0]); $i++) {
                                                          if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) { 
                                                              $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
                                                          }
                                                      }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 2 hrs to fix
                                                  system/mpdf/classes/cssmgr.php on lines 23..27

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

                                                  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

                                                      for($i=0; $i<count($m[0]); $i++) {
                                                          if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) { 
                                                              $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
                                                          }
                                                      }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 2 hrs to fix
                                                  system/mpdf/classes/cssmgr.php on lines 29..33

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                  if (preg_match('/^\s*[\.\-0-9]/',$p[3])) {
                                                                      $new['spread'] = $this->mpdf->ConvertSize(trim($p[3]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false); 
                                                                  }
                                                                  else { $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[3])); }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 2 hrs to fix
                                                  system/mpdf/classes/cssmgr.php on lines 787..790

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (preg_match('/^\s*[\.\-0-9]/',$p[2])) {
                                                                  $new['blur'] = $this->mpdf->ConvertSize(trim($p[2]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false); 
                                                              }
                                                              else { $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[2])); }
                                                  Severity: Major
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 2 hrs to fix
                                                  system/mpdf/classes/cssmgr.php on lines 792..795

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                                  if (strtolower($m[2])=='deg') { $angle = $angle; }
                                                                  else if (strtolower($m[2])=='grad') { $angle *= (360/400); }
                                                                  else if (strtolower($m[2])=='rad') { $angle = rad2deg($angle); }
                                                  Severity: Minor
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 55 mins to fix
                                                  system/mpdf/classes/grad.php on lines 483..485

                                                  Duplicated Code

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

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

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

                                                  Tuning

                                                  This issue has a mass of 98.

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                          if (isset($this->CSS[$tag.'>>LANG>>'.$attr['LANG']]) && $this->CSS[$tag.'>>LANG>>'.$attr['LANG']]) {
                                                              $zp = $this->CSS[$tag.'>>LANG>>'.$attr['LANG']];
                                                              if ($tag=='TD' || $tag=='TH')  { $this->setBorderDominance($zp, 9); }    // *TABLES*    // *TABLES-ADVANCED-BORDERS*
                                                              if (is_array($zp)) { 
                                                                  $p = array_merge($p,$zp); 
                                                  Severity: Minor
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 45 mins to fix
                                                  system/mpdf/classes/cssmgr.php on lines 1429..1436

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                      if (isset($attr['ID']) && isset($this->CSS[$tag.'>>ID>>'.$attr['ID']]) && $this->CSS[$tag.'>>ID>>'.$attr['ID']]) {
                                                              $zp = $this->CSS[$tag.'>>ID>>'.$attr['ID']];
                                                              if ($tag=='TD' || $tag=='TH')  { $this->setBorderDominance($zp, 9); }    // *TABLES*    // *TABLES-ADVANCED-BORDERS*
                                                              if (is_array($zp)) { 
                                                                  $p = array_merge($p,$zp); 
                                                  Severity: Minor
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 45 mins to fix
                                                  system/mpdf/classes/cssmgr.php on lines 1410..1425

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

                                                  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

                                                              else if (count($prop) == 2 ) { 
                                                                  $newprop['TEXT-OUTLINE-WIDTH'] = $prop[0];
                                                                  $newprop['TEXT-OUTLINE-COLOR'] = $prop[1];
                                                              }
                                                              else if (count($prop) == 3 ) { 
                                                  Severity: Minor
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 45 mins to fix
                                                  system/mpdf/classes/cssmgr.php on lines 604..611

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                              if (count($prop) == 1 ) { 
                                                                  $newprop['BORDER-SPACING-H'] = $prop[0];
                                                                  $newprop['BORDER-SPACING-V'] = $prop[0];
                                                              }
                                                              else if (count($prop) == 2 ) { 
                                                  Severity: Minor
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 45 mins to fix
                                                  system/mpdf/classes/cssmgr.php on lines 618..625

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                          if (isset($this->CSS['LANG>>'.$attr['LANG']]) && $this->CSS['LANG>>'.$attr['LANG']]) {
                                                              $zp = $this->CSS['LANG>>'.$attr['LANG']];
                                                              if ($tag=='TD' || $tag=='TH')  { $this->setBorderDominance($zp, 9); }    // *TABLES*    // *TABLES-ADVANCED-BORDERS*
                                                              if (is_array($zp)) { 
                                                                  $p = array_merge($p,$zp); 
                                                  Severity: Minor
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 35 mins to fix
                                                  system/mpdf/classes/cssmgr.php on lines 1387..1394

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

                                                  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

                                                      for($i=0; $i<$c; $i++) {
                                                          $col = preg_replace('/,/','*',$x[0][$i]);
                                                          $v = preg_replace('/'.preg_quote($x[0][$i],'/').'/',$col,$v);
                                                      }
                                                  Severity: Minor
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 35 mins to fix
                                                  system/mpdf/classes/cssmgr.php on lines 810..813

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

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

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

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

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

                                                  Refactorings

                                                  Further Reading

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

                                                      if (isset($attr['ID']) && isset($this->CSS['ID>>'.$attr['ID']]) && $this->CSS['ID>>'.$attr['ID']]) {
                                                              $zp = $this->CSS['ID>>'.$attr['ID']];
                                                              if ($tag=='TD' || $tag=='TH')  { $this->setBorderDominance($zp, 9); }    // *TABLES*    // *TABLES-ADVANCED-BORDERS*
                                                              if (is_array($zp)) { 
                                                                  $p = array_merge($p,$zp); 
                                                  Severity: Minor
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 35 mins to fix
                                                  system/mpdf/classes/cssmgr.php on lines 1368..1383

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

                                                  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

                                                      for($i=0; $i<$c; $i++) {
                                                          $col = preg_replace('/,/','*',$x[0][$i]);
                                                          $v = preg_replace('/'.preg_quote($x[0][$i],'/').'/',$col,$v);
                                                      }
                                                  Severity: Minor
                                                  Found in system/mpdf/classes/cssmgr.php and 1 other location - About 35 mins to fix
                                                  system/mpdf/classes/cssmgr.php on lines 775..778

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

                                                  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