arastta/arastta

View on GitHub
system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php

Summary

Maintainability
F
1 mo
Test Coverage

Function load has a Cognitive Complexity of 1540 (exceeds 5 allowed). Consider refactoring.
Open

    public function load($pFilename)
    {
        // Check if file exists
        if (!file_exists($pFilename)) {
            throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
Severity: Minor
Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.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

Method load has 1151 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function load($pFilename)
    {
        // Check if file exists
        if (!file_exists($pFilename)) {
            throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
Severity: Major
Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 5 days to fix

    File Excel2007.php has 1594 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * PHPExcel
     *
     * Copyright (c) 2006 - 2014 PHPExcel
    Severity: Major
    Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 4 days to fix

      Function _parseRichText has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
      Open

          private function _parseRichText($is = null) {
              $value = new PHPExcel_RichText();
      
              if (isset($is->t)) {
                  $value->createText( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $is->t ) );
      Severity: Minor
      Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.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 _readStyle has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
      Open

          private static function _readStyle($docStyle, $style) {
              // format code
      //        if (isset($style->numFmt)) {
      //            if (isset($style->numFmt['formatCode'])) {
      //                $docStyle->getNumberFormat()->setFormatCode((string) $style->numFmt['formatCode']);
      Severity: Minor
      Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.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 listWorksheetInfo has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function listWorksheetInfo($pFilename)
          {
              // Check if file exists
              if (!file_exists($pFilename)) {
                  throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
      Severity: Minor
      Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.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 _readStyle has 104 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function _readStyle($docStyle, $style) {
              // format code
      //        if (isset($style->numFmt)) {
      //            if (isset($style->numFmt['formatCode'])) {
      //                $docStyle->getNumberFormat()->setFormatCode((string) $style->numFmt['formatCode']);
      Severity: Major
      Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 4 hrs to fix

        Function _readColor has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function _readColor($color, $background=FALSE) {
                if (isset($color["rgb"])) {
                    return (string)$color["rgb"];
                } else if (isset($color["indexed"])) {
                    return PHPExcel_Style_Color::indexedColor($color["indexed"]-7,$background)->getARGB();
        Severity: Minor
        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.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 listWorksheetInfo has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function listWorksheetInfo($pFilename)
            {
                // Check if file exists
                if (!file_exists($pFilename)) {
                    throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
        Severity: Major
        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 2 hrs to fix

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

              private function _readRibbon($excel, $customUITarget, $zip)
              {
                  $baseDir = dirname($customUITarget);
                  $nameCustomUI = basename($customUITarget);
                  // get the xml file (ribbon)
          Severity: Minor
          Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.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 _parseRichText has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function _parseRichText($is = null) {
                  $value = new PHPExcel_RichText();
          
                  if (isset($is->t)) {
                      $value->createText( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $is->t ) );
          Severity: Minor
          Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 2 hrs to fix

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

                public function canRead($pFilename)
                {
                    // Check if file exists
                    if (!file_exists($pFilename)) {
                        throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
            Severity: Minor
            Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.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 _readRibbon has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function _readRibbon($excel, $customUITarget, $zip)
                {
                    $baseDir = dirname($customUITarget);
                    $nameCustomUI = basename($customUITarget);
                    // get the xml file (ribbon)
            Severity: Minor
            Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 1 hr to fix

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

                  private static function toCSSArray($style) {
                      $style = str_replace(array("\r","\n"), "", $style);
              
                      $temp = explode(';', $style);
                      $style = array();
              Severity: Minor
              Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 55 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                  private function _castToFormula($c,$r,&$cellDataType,&$value,&$calculatedValue,&$sharedFormulas,$castBaseType) {
              Severity: Major
              Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 50 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                    if (isset($tmpNumFmt["formatCode"])) {
                                                        $numFmt = (string) $tmpNumFmt["formatCode"];
                                                    }
                Severity: Major
                Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

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

                      public function listWorksheetNames($pFilename)
                      {
                          // Check if file exists
                          if (!file_exists($pFilename)) {
                              throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
                  Severity: Minor
                  Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Avoid deeply nested control flow statements.
                  Open

                                                          if (isset($xmlSheet->sheetViews->sheetView->pane['xSplit'])) {
                                                              $xSplit = 1 + intval($xmlSheet->sheetViews->sheetView->pane['xSplit']);
                                                          }
                  Severity: Major
                  Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                        if (isset($xmlSheet->sheetViews->sheetView->selection['sqref'])) {
                                                            $sqref = (string)$xmlSheet->sheetViews->sheetView->selection['sqref'];
                                                            $sqref = explode(' ', $sqref);
                                                            $sqref = $sqref[0];
                                                            $docSheet->setSelectedCells($sqref);
                    Severity: Major
                    Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                              if (intval($col["max"]) == 16384) {
                                                                  break;
                                                              }
                      Severity: Major
                      Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                                    if (($column !== NULL) && ($row !== NULL)) {
                                                                        // Set comment properties
                                                                        $comment = $docSheet->getCommentByColumnAndRow((string) $column, $row + 1);
                                                                        $comment->getFillColor()->setRGB( $fillColor );
                        
                        
                        Severity: Major
                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                                  if ($xmlDrawing->oneCellAnchor) {
                                                                      foreach ($xmlDrawing->oneCellAnchor as $oneCellAnchor) {
                                                                          if ($oneCellAnchor->pic->blipFill) {
                                                                              $blip = $oneCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip;
                                                                              $xfrm = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm;
                          Severity: Major
                          Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                    if ($col["style"] && !$this->_readDataOnly) {
                                                                        $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setXfIndex(intval($col["style"]));
                                                                    }
                            Severity: Major
                            Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                      if (self::boolean($col["bestFit"])) {
                                                                          //$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setAutoSize(TRUE);
                                                                      }
                              Severity: Major
                              Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                        if ($filterColumn->dynamicFilter) {
                                                                            $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER);
                                                                            //    We should only ever have one dynamic filter
                                                                            foreach ($filterColumn->dynamicFilter as $filterRule) {
                                                                                $column->createRule()->setRule(
                                Severity: Major
                                Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                          if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink") {
                                                                              $hyperlinks[(string)$ele["Id"]] = (string)$ele["Target"];
                                                                          }
                                  Severity: Major
                                  Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                                if (isset($hyperlink['tooltip'])) {
                                                                                    $cell->getHyperlink()->setTooltip( (string)$hyperlink['tooltip'] );
                                                                                }
                                    Severity: Major
                                    Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                                  if ($mapSheetId[(integer) $definedName['localSheetId']] !== null) {
                                                                                      $range = explode('!', (string)$definedName);
                                                                                      if (count($range) == 2) {
                                                                                          $range[0] = str_replace("''", "'", $range[0]);
                                                                                          $range[0] = str_replace("'", "", $range[0]);
                                      Severity: Major
                                      Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                                if (self::boolean($col["hidden"])) {
                                                                                // echo PHPExcel_Cell::stringFromColumnIndex($i),': HIDDEN COLUMN',PHP_EOL;
                                                                                    $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setVisible(FALSE);
                                                                                }
                                        Severity: Major
                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                                  if ($relsDrawing && $relsDrawing->Relationship) {
                                                                                      foreach ($relsDrawing->Relationship as $ele) {
                                                                                          if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
                                                                                              $images[(string) $ele["Id"]] = self::dir_add($fileDrawing, $ele["Target"]);
                                                                                          } elseif ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart") {
                                          Severity: Major
                                          Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                                    switch ((string)$definedName['name']) {
                                            
                                                                                        case '_xlnm._FilterDatabase':
                                                                                            if ((string)$definedName['hidden'] !== '1') {
                                                                                                $extractedRange = explode(',', $extractedRange);
                                            Severity: Major
                                            Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                                  if ($locatedSheet !== NULL) {
                                                                                      $excel->addNamedRange( new PHPExcel_NamedRange((string)$definedName['name'], $locatedSheet, $extractedRange, false) );
                                                                                  }
                                              Severity: Major
                                              Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                                            if (!$this->getReadFilter()->readCell($coordinates[0], $coordinates[1], $docSheet->getTitle())) {
                                                                                                continue;
                                                                                            }
                                                Severity: Major
                                                Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                                              if (isset($linkRel['id'])) {
                                                                                                  $hyperlinkUrl = $hyperlinks[ (string)$linkRel['id'] ];
                                                                                                  if (isset($hyperlink['location'])) {
                                                                                                      $hyperlinkUrl .= '#' . (string) $hyperlink['location'];
                                                                                                  }
                                                  Severity: Major
                                                  Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                                    if (isset($chartDetails[$chartPositionRef])) {
                                                    //                                    var_dump($chartDetails[$chartPositionRef]);
                                                    
                                                                                        $excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart);
                                                                                        $objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet']));
                                                    Severity: Major
                                                    Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                                                          if ($value instanceof PHPExcel_RichText) {
                                                                                                              $value = clone $value;
                                                                                                          }
                                                      Severity: Major
                                                      Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                                if (self::boolean($col["collapsed"])) {
                                                                                                    $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setCollapsed(TRUE);
                                                                                                }
                                                        Severity: Major
                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                                                              if (isset($c->f['t'])) {
                                                                                                                  $att = array();
                                                                                                                  $att = $c->f;
                                                                                                                  $docSheet->getCell($r)->setFormulaAttributes($att);
                                                                                                              }
                                                          Severity: Major
                                                          Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                                    if ($filterColumn->top10) {
                                                                                                        $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER);
                                                                                                        //    We should only ever have one top10 filter
                                                                                                        foreach ($filterColumn->top10 as $filterRule) {
                                                                                                            $column->createRule()->setRule(
                                                            Severity: Major
                                                            Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                                  if (isset($cellStyles[intval($cellStyle['xfId'])])) {
                                                                                                      // Set default style
                                                                                                      $style = new PHPExcel_Style;
                                                                                                      self::_readStyle($style, $cellStyles[intval($cellStyle['xfId'])]);
                                                              
                                                              
                                                              Severity: Major
                                                              Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                                            if (is_array($clientData) && !empty($clientData)) {
                                                                                                                $clientData   = $clientData[0];
                                                                
                                                                                                                if ( isset($clientData['ObjectType']) && (string)$clientData['ObjectType'] == 'Note' ) {
                                                                                                                    $temp = $clientData->xpath('.//x:Row');
                                                                Severity: Major
                                                                Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                                          if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing") {
                                                                                                              $vmlComments[(string)$ele["Id"]] = (string)$ele["Target"];
                                                                                                          }
                                                                  Severity: Major
                                                                  Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                                        if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
                                                                                                            $relsWorksheet = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip,  dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
                                                                                                            $vmlRelationship = '';
                                                                    
                                                                                                            foreach ($relsWorksheet->Relationship as $ele) {
                                                                    Severity: Major
                                                                    Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                                              if (isset($xmlSheet->sheetViews->sheetView->pane['ySplit'])) {
                                                                                                                  $ySplit = 1 + intval($xmlSheet->sheetViews->sheetView->pane['ySplit']);
                                                                                                              }
                                                                      Severity: Major
                                                                      Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                                                if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") {
                                                                                                                    $comments[(string)$ele["Id"]] = (string)$ele["Target"];
                                                                                                                }
                                                                        Severity: Major
                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                                              if (strpos( (string)$definedName, '!' ) !== false) {
                                                                                                                  // Extract sheet name
                                                                                                                  $extractedSheetName = PHPExcel_Worksheet::extractSheetTitle( (string)$definedName, true );
                                                                                                                  $extractedSheetName = $extractedSheetName[0];
                                                                          
                                                                          
                                                                          Severity: Major
                                                                          Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                                        if ($value == (int)$value) $value = (int)$value;
                                                                                                                        elseif ($value == (float)$value) $value = (float)$value;
                                                                                                                        elseif ($value == (double)$value) $value = (double)$value;
                                                                            Severity: Major
                                                                            Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                                      if ($col["outlineLevel"] > 0) {
                                                                                                                          $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col["outlineLevel"]));
                                                                                                                      }
                                                                              Severity: Major
                                                                              Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                                        if ($filterColumn->filters) {
                                                                                                                            $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER);
                                                                                                                            $filters = $filterColumn->filters;
                                                                                                                            if ((isset($filters["blank"])) && ($filters["blank"] == 1)) {
                                                                                                                                $column->createRule()->setRule(
                                                                                Severity: Major
                                                                                Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                                          if ($filterColumn->customFilters) {
                                                                                                                              $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER);
                                                                                                                              $customFilters = $filterColumn->customFilters;
                                                                                                                              //    Custom filters can an AND or an OR join;
                                                                                                                              //        and there should only ever be one or two entries
                                                                                  Severity: Major
                                                                                  Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                                            if ($xmlDrawing->twoCellAnchor) {
                                                                                                                                foreach ($xmlDrawing->twoCellAnchor as $twoCellAnchor) {
                                                                                                                                    if ($twoCellAnchor->pic->blipFill) {
                                                                                                                                        $blip = $twoCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip;
                                                                                                                                        $xfrm = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm;
                                                                                    Severity: Major
                                                                                    Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 45 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                              return 'FF000000';
                                                                                      Severity: Major
                                                                                      Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php - About 30 mins to fix

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

                                                                                                                                            if ($outerShdw) {
                                                                                                                                                $shadow = $objDrawing->getShadow();
                                                                                                                                                $shadow->setVisible(true);
                                                                                                                                                $shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "blurRad")));
                                                                                                                                                $shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "dist")));
                                                                                        Severity: Major
                                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php and 1 other location - About 5 hrs to fix
                                                                                        system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on lines 1477..1486

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

                                                                                        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 ($outerShdw) {
                                                                                                                                                $shadow = $objDrawing->getShadow();
                                                                                                                                                $shadow->setVisible(true);
                                                                                                                                                $shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "blurRad")));
                                                                                                                                                $shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "dist")));
                                                                                        Severity: Major
                                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php and 1 other location - About 5 hrs to fix
                                                                                        system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on lines 1518..1527

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

                                                                                        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

                                                                                                                    $cellStyle = (object) array(
                                                                                                                        "numFmt" => $numFmt,
                                                                                                                        "font" => $xmlStyles->fonts->font[intval($xf["fontId"])],
                                                                                                                        "fill" => $xmlStyles->fills->fill[intval($xf["fillId"])],
                                                                                                                        "border" => $xmlStyles->borders->border[intval($xf["borderId"])],
                                                                                        Severity: Major
                                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php and 1 other location - About 1 hr to fix
                                                                                        system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on lines 538..546

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 106.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                                    $style = (object) array(
                                                                                                                        "numFmt" => $numFmt,
                                                                                                                        "font" => $xmlStyles->fonts->font[intval($xf["fontId"])],
                                                                                                                        "fill" => $xmlStyles->fills->fill[intval($xf["fillId"])],
                                                                                                                        "border" => $xmlStyles->borders->border[intval($xf["borderId"])],
                                                                                        Severity: Major
                                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php and 1 other location - About 1 hr to fix
                                                                                        system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on lines 566..574

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 106.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                            if (isset($run->rPr->vertAlign) && isset($run->rPr->vertAlign["val"])) {
                                                                                                                $vertAlign = strtolower((string)$run->rPr->vertAlign["val"]);
                                                                                                                if ($vertAlign == 'superscript') {
                                                                                                                    $objText->getFont()->setSuperScript(TRUE);
                                                                                                                }
                                                                                        Severity: Minor
                                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php and 1 other location - About 50 mins to fix
                                                                                        system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on lines 1820..1828

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 97.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                    if (isset($style->font->vertAlign) && isset($style->font->vertAlign["val"])) {
                                                                                                        $vertAlign = strtolower((string)$style->font->vertAlign["val"]);
                                                                                                        if ($vertAlign == 'superscript') {
                                                                                                            $docStyle->getFont()->setSuperScript(true);
                                                                                                        }
                                                                                        Severity: Minor
                                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php and 1 other location - About 50 mins to fix
                                                                                        system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on lines 1967..1975

                                                                                        Duplicated Code

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

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

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

                                                                                        Tuning

                                                                                        This issue has a mass of 97.

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

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

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

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

                                                                                        Refactorings

                                                                                        Further Reading

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

                                                                                                                        if (($spos = strpos($extractedRange,'!')) !== false) {
                                                                                                                            $extractedRange = substr($extractedRange,0,$spos).str_replace('$', '', substr($extractedRange,$spos));
                                                                                                                        } else {
                                                                                                                            $extractedRange = str_replace('$', '', $extractedRange);
                                                                                                                        }
                                                                                        Severity: Minor
                                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php and 1 other location - About 45 mins to fix
                                                                                        system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on lines 1563..1567

                                                                                        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

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

                                                                                                                            if (($spos = strpos($extractedRange,'!')) !== false) {
                                                                                                                                $extractedRange = substr($extractedRange,0,$spos).str_replace('$', '', substr($extractedRange,$spos));
                                                                                                                            } else {
                                                                                                                                $extractedRange = str_replace('$', '', $extractedRange);
                                                                                                                            }
                                                                                        Severity: Minor
                                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php and 1 other location - About 45 mins to fix
                                                                                        system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on lines 1642..1646

                                                                                        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($style->font->u) && !isset($style->font->u["val"])) {
                                                                                                        $docStyle->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
                                                                                                    } else if (isset($style->font->u) && isset($style->font->u["val"])) {
                                                                                                        $docStyle->getFont()->setUnderline((string)$style->font->u["val"]);
                                                                                                    }
                                                                                        Severity: Minor
                                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php and 1 other location - About 35 mins to fix
                                                                                        system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on lines 1977..1981

                                                                                        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($run->rPr->u) && !isset($run->rPr->u["val"])) {
                                                                                                                $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
                                                                                                            } else if (isset($run->rPr->u) && isset($run->rPr->u["val"])) {
                                                                                                                $objText->getFont()->setUnderline((string)$run->rPr->u["val"]);
                                                                                                            }
                                                                                        Severity: Minor
                                                                                        Found in system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php and 1 other location - About 35 mins to fix
                                                                                        system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on lines 1814..1818

                                                                                        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