CloneSet58


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
56210.981class_member_list[3]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
154125
administrator/components/com_media/helpers/media.php
25667
components/com_media/helpers/media.php
Clone Instance
1
Line Count
54
Source Line
125
Source File
administrator/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
                            );
              }


Clone Instance
2
Line Count
56
Source Line
67
Source File
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);

                //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
                            );
              }


Clone AbstractionParameter Count: 1Parameter Bindings

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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#46d3c780]]
"width=\"$width\" height=\"$height\"" 
12[[#46d3c780]]
array( $width,
       $height
     )