Skip to content
jabiercoding edited this page Mar 15, 2022 · 18 revisions

Java source code (JDT adapter)

  • id: jdt
  • Plugin: org.but4reuse.adapters.javajdt
  • Adaptable: Folders with Java source code or individual Java files

C/C++ source code (CDT adapter)

  • id: cpp
  • Plugin: org.but4reuse.adapters.cppcdt
  • Adaptable: Folders with C/C++ source code or individual C/C++ files
  • Dependencies: AST dependencies. To enrich the dependency information (e.g., method calling another method), there is a preference that can be activated requiring a path to Doxygen
  • Other: Requires Eclipse CDT.

EMF models

  • id: models
  • Plugin: org.but4reuse.adapters.emf
  • Adaptable: EMF model
  • Elements: EMFClassElement, EMFAttributeElement and EMFReferenceElement
  • Adapt: Pre-Order model traversal of containment relations
  • Similarity: EMF DiffMerge operations
  • Dependencies: Container dependency of classes, attributes and references. Referenced elements dependencies.
  • Construct: Use CVLExtractorTutorial to create CVL models. Extra plugin: org.but4reuse.adapters.emf.cvl. The plugin org.but4reuse.adapters.emf also allows to create a construct based on creating 150% models.
  • Other: Requires EMF Diff/Merge v0.4.1 installation. EMF Diff/Merge v0.4.1 download. Related documentation can be found as research publication. If the default comparison method is not valid for your models, you should implement the EMF diffmerge extension point for contributing comparisons (org.eclipse.emf.diffmerge.ui.modelComparisonContext), and BUT4Reuse will automatically use it. Check also CVLExtractorTutorial for installing the CVL plugin if you need it.

Text lines

  • id: textlines
  • Plugin: org.but4reuse.adapters.textlines
  • Adaptable: Any file that is not a folder
  • Elements: LineElement.
  • Adapt: The file is read line by line
  • Similarity: Levenshtein distance between strings
  • Dependencies: None
  • Construct: Append the line strings to an empty file

File structure

  • id: filestructure
  • Plugin: org.but4reuse.adapters.filestructure
  • Adaptable: Any folder
  • Elements: FileElement and FolderElement (FolderElement extends FileElement)
  • Adapt: Pre-Order tree traversal of its structure
  • Similarity: Name and relative path to the initial folder. Optionally file contents based on MD5 hashing
  • Dependencies: Containment dependency
  • Construct: Copy the resources in a given destination

JaCoCo

  • id: jacoco
  • Plugin: org.but4reuse.adapters.jacoco
  • Adaptable: JaCoCo XML sessions
  • Elements: CoveredLineElement

C and Java source code (This is a different alternative to the CDT or JDT adapters)

  • id: c or java
  • Plugin: org.but4reuse.adapters.sourcecode
  • Adaptable: A folder containing source code
  • Elements: FSTNonTerminalNode and FSTTerminalNode
  • Adapt: FeatureHouse source code visitor
  • Similarity: Feature Structure Tree (FST) positions and names comparison
  • Dependencies: FST nodes containment dependencies. Other dependencies such as Call Dependency Graphs (on-going work)
  • Construct: FeatureHouse extraction creating code fragments
  • Other: We embedded the FeatureHouse library in the adapter. No need to install.

Images

  • id: images
  • Plugin: org.but4reuse.adapters.images
  • Adaptable: An image file in jpg, bmp, png, gif or ico format.
  • Elements: PixelElement
  • Adapt: Image pixel matrix visitor ignoring completely transparent pixels.
  • Similarity: Pixel cartesian coordinates, color and transparency.
  • Dependencies: A pixel depends on its position.
  • Construct: An image with the selected pixels.
  • Other: Check the Tutorial

Comma-Separated-Value

  • id: csv
  • Plugin: org.but4reuse.adapters.csv
  • Adaptable: A csv file
  • Elements: CellElement
  • Adapt: csv matrix visitor
  • Similarity: Cell coordinates and String comparison of the value
  • Dependencies: A cell depends on its position.
  • Construct: A csv file with the selected cells.

Requirements

Eclipse installations adapter

  • id: eclipse
  • Plugin: org.but4reuse.adapters.eclipse
  • Adaptable: Eclipse installation folder
  • Elements: PluginElement and FileElement (PluginElement extends FileElement)
  • Adapt: Eclipse folder structure visitor
  • Similarity: Plugin ids and for the rest of the files, the same as in the filestructure adapter.
  • Dependencies: Plugin required bundles. Fragments have a dependency to the plugin host. Files have a containment dependency.
  • Construct: The selected plugins and files. Adjustment of the bundles.info configuration file.

Graphs adapter

  • id: graphs
  • Plugin: org.but4reuse.adapters.graphs
  • Adaptable: A GraphML or GML file
  • Elements: VertexElement and EdgeElement
  • Adapt: Blueprints Tinkerpop graph visitor
  • Similarity: Label string similarity. The attributes used for the label can be defined in the adapter user preferences.
  • Dependencies: Vertex dependency based on the edges
  • Construct: Subgraphs creation in GraphML format
  • Other: Uses Blueprints Tinkerpop but we embedded the library in the plugin. No installation needed.

Natural language text

  • id: nltext
  • Plugin: org.but4reuse.adapters.nltext
  • Adaptable: Any file
  • Elements: SentenceElement
  • Adapt: Sentence splitter using OpenNLP library
  • Similarity: WUP natural language comparison similarity
  • Dependencies: None defined
  • Construct: A file with the selected sentences
  • Other: Uses OpenNLP but we embedded the library in the plugin. No installation needed.

Music scores

  • id: music
  • Plugin: org.but4reuse.adapters.music
  • Adaptable: MusicXML file
  • Elements: NoteElement
  • Adapt: MusicXML parser
  • Similarity: Same note position in the measure, same pitch and duration. (On-going work)
  • Dependencies: Position (On-going work)
  • Construct: A MusicXML file with the selected notes (On-going work)

JSON

  • id: json
  • Plugin: org.but4reuse.adapters.json
  • Adaptable: A JSON file
  • Elements: ObjectElement, KeyElement, ValueElement, ArrayElement, IndexArrayElement
  • Adapt: JSON parser. It adapts the JSON file as a tree.
  • Similarity: The path to the root including array indexes
  • Dependencies: The parent element
  • Construct: A JSON file

Scratch games

  • id: scratch
  • Plugin: org.but4reuse.adapters.scratch
  • Adaptable: The JSON file of the game
  • Elements: ScratchElement
  • Adapt: It uses the JSON parser internally
  • Similarity: The path to the root including array indexes
  • Dependencies: The parent element
  • Construct: A complete sb2 file with the project.json and all the needed resources (images etc.)

Clone this wiki locally