| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 56 | 2 | 1 | 0.981 | class_member_list[3] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 54 | 125 | administrator/components/com_media/helpers/media.php |
| 2 | 56 | 67 | components/com_media/helpers/media.php |
| ||||
function parseSize($size) {
if ($size< 1024) {
return $size
. ' bytes';
}
else {
if ($size>= 1024
&& $size< 1024* 1024) {
return sprintf('%01.2f', $size/ 1024.0)
. ' Kb';
}
else {
return sprintf('%01.2f', $size/ (1024.0* 1024))
. ' Mb';
}
}
}
function imageResize($width, $height, $target) {
//takes the larger size of the width and height and applies the
//formula accordingly...this is so this script will work
//dynamically with any size image
if ($width> $height) {
$percentage= ($target/ $width);
}
else {
$percentage= ($target/ $height);
}
//gets the new value and applies the percentage, then rounds the value
$width= round($width* $percentage);
$height= round($height* $percentage);
return array( $width, $height
);
}
function countFiles($dir) {
$total_file= 0;
$total_dir= 0;
if (is_dir($dir)) {
$d= dir($dir);
while (FALSE !== ($entry= $d->read())) {
if (substr($entry, 0, 1) != '.'
&& is_file($dir
. DIRECTORY_SEPARATOR
. $entry)
&& strpos($entry, '.html') === FALSE
&& strpos($entry, '.php') === FALSE) {
$total_file ++;
}
if (substr($entry, 0, 1) != '.'
&& is_dir($dir
. DIRECTORY_SEPARATOR
. $entry)) {
$total_dir ++;
}
}
$d->close();
}
return array( $total_file, $total_dir
);
}
|
| ||||
function parseSize($size) {
if ($size< 1024) {
return $size
. ' bytes';
}
else {
if ($size>= 1024
&& $size< 1024* 1024) {
return sprintf('%01.2f', $size/ 1024.0)
. ' Kb';
}
else {
return sprintf('%01.2f', $size/ (1024.0* 1024))
. ' Mb';
}
}
}
function imageResize($width, $height, $target) {
//takes the larger size of the width and height and applies the
//formula accordingly...this is so this script will work
//dynamically with any size image
if ($width> $height) {
$percentage= ($target/ $width);
}
else {
$percentage= ($target/ $height);
}
//gets the new value and applies the percentage, then rounds the value
$width= round($width* $percentage);
$height= round($height* $percentage);
//returns the new sizes in html image tag format...this is so you
//can plug this function inside an image tag and just get the
return "width=\"$width\" height=\"$height\"";
}
function countFiles($dir) {
$total_file= 0;
$total_dir= 0;
if (is_dir($dir)) {
$d= dir($dir);
while (FALSE !== ($entry= $d->read())) {
if (substr($entry, 0, 1) != '.'
&& is_file($dir
. DIRECTORY_SEPARATOR
. $entry)
&& strpos($entry, '.html') === FALSE
&& strpos($entry, '.php') === FALSE) {
$total_file ++;
}
if (substr($entry, 0, 1) != '.'
&& is_dir($dir
. DIRECTORY_SEPARATOR
. $entry)) {
$total_dir ++;
}
}
$d->close();
}
return array( $total_file, $total_dir
);
}
|
| |||
function parseSize($size) {
if ($size<1024) {
return $size
. ' bytes';
}
else {
if ($size>=1024
&& $size<1024*1024) {
return sprintf('%01.2f',$size/1024.0)
. ' Kb';
}
else {
return sprintf('%01.2f',$size/(1024.0*1024))
. ' Mb';
}
}
}
function imageResize($width,$height,$target) {
//takes the larger size of the width and height and applies the
//formula accordingly...this is so this script will work
//dynamically with any size image
if ($width>$height) {
$percentage=($target/$width);
}
else {
$percentage=($target/$height);
}
//gets the new value and applies the percentage, then rounds the value
$width=round($width*$percentage);
$height=round($height*$percentage);
//returns the new sizes in html image tag format...this is so you
//can plug this function inside an image tag and just get the
return [[#variable46d3c780]];
}
function countFiles($dir) {
$total_file=0;
$total_dir=0;
if (is_dir($dir)) {
$d=dir($dir);
while (FALSE !== ($entry=$d->read())) {
if (substr($entry,0,1) != '.'
&& is_file($dir
. DIRECTORY_SEPARATOR
. $entry)
&& strpos($entry,'.html') === FALSE
&& strpos($entry,'.php') === FALSE) {
$total_file ++;
}
if (substr($entry,0,1) != '.'
&& is_dir($dir
. DIRECTORY_SEPARATOR
. $entry)) {
$total_dir ++;
}
}
$d->close();
}
return array( $total_file,
$total_dir
);
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#46d3c780]] | "width=\"$width\" height=\"$height\"" |
| 1 | 2 | [[#46d3c780]] | array( $width,
$height
) |