CloneSet27


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
87220.963statement_sequence[16]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
187149
installation/models/filesystem.php
287301
installation/models/filesystem.php
Clone Instance
1
Line Count
87
Source Line
149
Source File
installation/models/filesystem.php

                // Verify PWD function
                if ($ftp->pwd() === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NOPWD'));
                        return FALSE;
                      }

                // Verify root path exists
                if (!$ftp->chdir($root)) {
                        $ftp->quit();
                        $this->setError(JText::_('NOROOT'));
                        return FALSE;
                      }

                // Verify NLST function
                if (($rootList=  $ftp->listNames()) === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NONLST'));
                        return FALSE;
                      }

                // Verify LIST function
                if ($ftp->listDetails() === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NOLIST'));
                        return FALSE;
                      }

                // Verify SYST function
                if ($ftp->syst() === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NOSYST'));
                        return FALSE;
                      }

                // Verify valid root path, part one
                $checkList=  array( 'robots.txt', 'index.php'
                                  );
                if (count(array_diff($checkList, $rootList))) {
                        $ftp->quit();
                        $this->setError(JText::_('INVALIDROOT'));
                        return FALSE;
                      }
                // Verify RETR function
                $buffer=  NULL;
                if ($ftp->read($root
                               .     '/libraries/joomla/version.php', $buffer) === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NORETR'));
                        return FALSE;
                      }
                // Verify valid root path, part two
                $checkValue=  file_get_contents(JPATH_LIBRARIES
                                                .               DS
                                                .                  'joomla'
                                                .                           DS
                                                .                              'version.php');
                if ($buffer !== $checkValue) {
                        $ftp->quit();
                        $this->setError(JText::_('INVALIDROOT'));
                        return FALSE;
                      }
                // Verify STOR function
                if ($ftp->create($root
                                 .     '/ftp_testfile') === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NOSTOR'));
                        return FALSE;
                      }
                // Verify DELE function
                if ($ftp->delete($root
                                 .     '/ftp_testfile') === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NODELE'));
                        return FALSE;
                      }
                // Verify MKD function
                if ($ftp->mkdir($root
                                .     '/ftp_testdir') === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NOMKD'));
                        return FALSE;
                      }
                // Verify RMD function
                if ($ftp->delete($root
                                 .     '/ftp_testdir') === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NORMD'));
                        return FALSE;
                      }
                $ftp->quit();


Clone Instance
2
Line Count
87
Source Line
301
Source File
installation/models/filesystem.php

                // Verify PWD function
                if ($ftp->pwd() === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NOPWD'));
                        return FALSE;
                      }

                // Verify root path exists
                if (!$ftp->chdir($root)) {
                        $ftp->quit();
                        $this->setError(JText::_('NOROOT'));
                        return FALSE;
                      }

                // Verify NLST function
                if (($rootList=  $ftp->listNames()) === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NONLST'));
                        return FALSE;
                      }

                // Verify LIST function
                if ($ftp->listDetails() === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NOLIST'));
                        return FALSE;
                      }

                // Verify SYST function
                if ($ftp->syst() === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NOSYST'));
                        return FALSE;
                      }

                // Verify valid root path, part one
                $checkList=  array( 'CHANGELOG.php', 'COPYRIGHT.php', 'index.php', 'INSTALL.php', 'LICENSE.php'
                                  );
                if (count(array_diff($checkList, $rootList))) {
                        $ftp->quit();
                        $this->setError(JText::_('INVALIDROOT'));
                        return FALSE;
                      }
                // Verify RETR function
                $buffer=  NULL;
                if ($ftp->read($root
                               .     '/libraries/joomla/version.php', $buffer) === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NORETR'));
                        return FALSE;
                      }
                // Verify valid root path, part two
                $checkValue=  file_get_contents(JPATH_LIBRARIES
                                                .               DS
                                                .                  'joomla'
                                                .                           DS
                                                .                              'version.php');
                if ($buffer !== $checkValue) {
                        $ftp->quit();
                        $this->setError(JText::_('INVALIDROOT'));
                        return FALSE;
                      }
                // Verify STOR function
                if ($ftp->create($root
                                 .     '/ftp_testfile') === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NOSTOR'));
                        return FALSE;
                      }
                // Verify DELE function
                if ($ftp->delete($root
                                 .     '/ftp_testfile') === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NODELE'));
                        return FALSE;
                      }
                // Verify MKD function
                if ($ftp->mkdir($root
                                .     '/ftp_testdir') === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NOMKD'));
                        return FALSE;
                      }
                // Verify RMD function
                if ($ftp->delete($root
                                 .     '/ftp_testdir') === FALSE) {
                        $ftp->quit();
                        $this->setError(JText::_('NORMD'));
                        return FALSE;
                      }
                return TRUE;


Clone AbstractionParameter Count: 2Parameter Bindings

// Verify PWD function
if ($ftp->pwd() === FALSE) {
  $ftp->quit();
  $this->setError(JText::_('NOPWD'));
  return FALSE;
}
// Verify root path exists
if (!$ftp->chdir($root)) {
  $ftp->quit();
  $this->setError(JText::_('NOROOT'));
  return FALSE;
}
// Verify NLST function
if (($rootList=$ftp->listNames()) === FALSE) {
  $ftp->quit();
  $this->setError(JText::_('NONLST'));
  return FALSE;
}
// Verify LIST function
if ($ftp->listDetails() === FALSE) {
  $ftp->quit();
  $this->setError(JText::_('NOLIST'));
  return FALSE;
}
// Verify SYST function
if ($ftp->syst() === FALSE) {
  $ftp->quit();
  $this->setError(JText::_('NOSYST'));
  return FALSE;
}
// Verify valid root path, part one
$checkList=array(  [[#variable50a34980]]
                );
if (count(array_diff($checkList,$rootList))) {
  $ftp->quit();
  $this->setError(JText::_('INVALIDROOT'));
  return FALSE;
}
// Verify RETR function
$buffer=NULL;
if ($ftp->read($root
               . '/libraries/joomla/version.php',$buffer) === FALSE) {
  $ftp->quit();
  $this->setError(JText::_('NORETR'));
  return FALSE;
}
// Verify valid root path, part two
$checkValue=file_get_contents(JPATH_LIBRARIES
                              . DS
                              . 'joomla'
                              . DS
                              . 'version.php');
if ($buffer !== $checkValue) {
  $ftp->quit();
  $this->setError(JText::_('INVALIDROOT'));
  return FALSE;
}
// Verify STOR function
if ($ftp->create($root
                 . '/ftp_testfile') === FALSE) {
  $ftp->quit();
  $this->setError(JText::_('NOSTOR'));
  return FALSE;
}
// Verify DELE function
if ($ftp->delete($root
                 . '/ftp_testfile') === FALSE) {
  $ftp->quit();
  $this->setError(JText::_('NODELE'));
  return FALSE;
}
// Verify MKD function
if ($ftp->mkdir($root
                . '/ftp_testdir') === FALSE) {
  $ftp->quit();
  $this->setError(JText::_('NOMKD'));
  return FALSE;
}
// Verify RMD function
if ($ftp->delete($root
                 . '/ftp_testdir') === FALSE) {
  $ftp->quit();
  $this->setError(JText::_('NORMD'));
  return FALSE;
}
 [[#variable48c0c460]]
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#50a34980]]
'robots.txt',
'index.php' 
12[[#50a34980]]
'CHANGELOG.php',
'COPYRIGHT.php',
'index.php',
'INSTALL.php',
'LICENSE.php' 
21[[#48c0c460]]
$ftp->quit(); 
22[[#48c0c460]]
return TRUE;