wiki:SuffixTreeBasedDuplicateCodeAnalysis

Version 2 (modified by manualwiki, 13 years ago) (diff)

--

Duplicate code analysis

Parameters

ParameterDescriptionDefault valueExample
filesfiles in which the search is carried outall files from the database{files,["/usr/local/lib/erlang/lib/mnesia-4.5/src/mnesia_log.erl","/usr/local/lib/erlang/lib/mnesia-4.5/src/mnesia_lib.erl"]}
minlenminimal length of a clone(in tokens)10{minlen,50}
minnumminimal number of clones in one clone group2{minnum,5}
overlapscale of the overlap0{overlap,1}
  • {files, Files} Files = [ Module::atom(), Filepath::string() | File::string() | RegExp::string() ]
  • {minlen, integer()}
  • {minnum, integer()}
  • {overlap, integer()}
  • {output, Filename::string()}
  • {name, atom()}

Examples

ri:search_duplicates([
        {files, ["/home/csibe/Downloads/examples/one.erl",
                         "^(/home)[0-9a-zA-Z/_]+(/src)$"]}]).
ri:search_duplicates([
        {files, ["/home/csibe/Downloads/examples/one.erl",
                         "^(/home)[0-9a-zA-Z/_]+(/src)$"]},
        {minlen, 50},
        {overlap, 1}]).