Source files: 17

Click here to show/hide file names

Clones detected: 3

46 of 1499 lines are duplicates (3.07%)

Parameters
clustering_threshold = 10
distance_threshold = 5
size_threshold = 5
hashing_depth = 1
clusterize_using_hash = False
clusterize_using_dcup = False

Time elapsed
Construction of AST : 8.49 seconds
Building statement hash : 0.11 seconds
Building patterns : 1.05 seconds
Marking similar statements : 1.34 seconds
Finding similar sequences of statements : 0.07 seconds
Refining candidates : 0.09 seconds
Total time: 11.16
Started at: Fri Aug 29 15:43:37 2008
Finished at: Fri Aug 29 15:43:48 2008

Clone # 1
Distance between two fragments = 2
Clone size = 10
Source file "/tmp/stdlib/modules/list.lua"
The first line is 332
Source file "/tmp/stdlib/modules/list.lua"
The first line is 349
function  indexKey  (f,  l)
  local  m  =  {}
  for  i,  v  in  ipairs  (l)  do
    local  k  =  v[f]
    if  k  then
      m[k]  =  i
    end
  end
  return  m
end
function  indexValue  (f,  l)
  local  m  =  {}
  for  i,  v  in  ipairs  (l)  do
    local  k  =  v[f]
    if  k  then
      m[k]  =  v
    end
  end
  return  m
end



Clone # 2
Distance between two fragments = 2
Clone size = 7
Source file "/tmp/stdlib/modules/table_ext.lua"
The first line is 77
Source file "/tmp/stdlib/modules/table_ext.lua"
The first line is 89
function  indices  (t)
  local  u  =  {}
  for  i,  v  in  pairs  (t)  do
    insert  (u,  i)
  end
  return  u
end
function  values  (t)
  local  u  =  {}
  for  i,  v  in  pairs  (t)  do
    insert  (u,  v)
  end
  return  u
end



Clone # 3
Distance between two fragments = 3
Clone size = 6
Source file "/tmp/stdlib/modules/string_ext.lua"
The first line is 304
Source file "/tmp/stdlib/modules/string_ext.lua"
The first line is 316
function  ltrim  (r,  s)
  if  s  ==  nil  then
    s,  r  =  r,  "%s+"
  end
  return  (r.gsub  (s,  "^"  ..  r,  ""))
end
function  rtrim  (r,  s)
  if  s  ==  nil  then
    s,  r  =  r,  "%s+"
  end
  return  (r.gsub  (s,  r  ..  "$",  ""))
end


(*) Warning: the highlighting of differences is based on diff and doesn't reflect the tree-based clone detection algorithm.


Clone Digger is aimed to find software clones in Python and Java programs. It is provided under the GPL license and can be downloaded from the site http://clonedigger.sourceforge.net