x Sorry, these patches are not available anymore due to data migration. Please run a fresh inspection.

Code Duplication    Length = 13-14 lines in 3 locations

app/Vendor/PHPExcel/PHPExcel/Shared/PCLZip/pclzip.lib.php 3 locations

@@ 1888-1901 (lines=14) @@
1885
1886
      // ----- Look for attribute
1887
      switch ($v_key) {
1888
        case PCLZIP_ATT_FILE_NAME :
1889
          if (!is_string($v_value)) {
1890
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
1891
            return PclZip::errorCode();
1892
          }
1893
1894
          $p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
1895
          
1896
          if ($p_filedescr['filename'] == '') {
1897
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
1898
            return PclZip::errorCode();
1899
          }
1900
1901
        break;
1902
1903
        case PCLZIP_ATT_FILE_NEW_SHORT_NAME :
1904
          if (!is_string($v_value)) {
@@ 1903-1915 (lines=13) @@
1900
1901
        break;
1902
1903
        case PCLZIP_ATT_FILE_NEW_SHORT_NAME :
1904
          if (!is_string($v_value)) {
1905
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
1906
            return PclZip::errorCode();
1907
          }
1908
1909
          $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);
1910
1911
          if ($p_filedescr['new_short_name'] == '') {
1912
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'");
1913
            return PclZip::errorCode();
1914
          }
1915
        break;
1916
1917
        case PCLZIP_ATT_FILE_NEW_FULL_NAME :
1918
          if (!is_string($v_value)) {
@@ 1917-1929 (lines=13) @@
1914
          }
1915
        break;
1916
1917
        case PCLZIP_ATT_FILE_NEW_FULL_NAME :
1918
          if (!is_string($v_value)) {
1919
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
1920
            return PclZip::errorCode();
1921
          }
1922
1923
          $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);
1924
1925
          if ($p_filedescr['new_full_name'] == '') {
1926
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'");
1927
            return PclZip::errorCode();
1928
          }
1929
        break;
1930
1931
        // ----- Look for options that takes a string
1932
        case PCLZIP_ATT_FILE_COMMENT :