Skip to content

T45K/CLIONE

Repository files navigation

Kotlin CI with Gradle

logo < Hello.

[EN] [JP]

What's CLIONE

CLIONE is a code clone modification support bot.
CLIONE execution is triggered by Pull Requests, and it notifies inconsistently modified or newly added clone sets between the pull requests.

Use as a GitHub bot

  1. Click here to register your GitHub account and repository to which you want to apply CLIONE.
  2. Create .clione/config.toml in your project.
  3. Edit config.toml by refering Settings
  4. Configuration is over. Let's create a pull request.

NOTICE!

Due to my graduation, CLIONE is currently unavailable as a GitHub bot. If you are interested in CLIONE, prepare your own server and deploy CLIONE on yourself.

Settings

simirality is integer type, and others are string type. Simple example is here.

Name Description Default value
src Relative path of source directory.
ex: src/main/java
src
lang Programming language. Following languages are selectable.
java, kotlin,python, cpp
java
clone_detector Clone Detector. Following detectors are selectable. Parentheses are the supported languages.
NiCad(java, python, cpp),SourcererCC(java, kotlin, python, cpp)
NiCad
granularity Granularity of clones. Followings are selectable.
method,block
block
similarity Similarity of clones. If you enter an integer d between 0 and 10, the clones are detected with a similarity of 10*d%. 8

Use as a server

You can build your own CLIONE server.

  1. Setting your GitHub Apps (see https://developer.github.com/apps/).
  2. Download Txl and NiCad clone detector from here and install them (if you use them).
  3. git clone git@github.com:T45K/CLIONE
  4. Fill in src/main/resources/github.properties, src/main/resources/verify.properties and src/main/resources/resource.properties.
  5. ./gradlew run (default port is 3000).

Use as a stand alone tool

You can also use CLIONE as a stand alone tool to detect modification-target clones from past pull requests.

  1. Download TXL and NiCad clone detector from here and install them (if you use them).
  2. git clone git@github.com:T45K/CLIONE
  3. Fill in src/main/resources/resource.properties and src/main/resources/stand_alone.properties.
    Settings(src, lang, etc.,) should be described in stand_alone.properties.
  4. ./gradlre standalone -Pargs = "user(or organization)_name/repo_name"

CLIONEとは

CLIONEはコードクローン修正支援ボットです.
プルリクエスト作成時に,プルリクエスト内で行われた変更の前後で,一貫修正されていないクローンセットや,新しく追加されたクローンセットを通知します.

ボットとして使う

  1. こちら からGitHubアカウントと適用したいリポジトリを登録してください.
  2. CLIONEを利用したいプロジェクトに内に.clione/config.tomlファイルを作成してください.
  3. 設定を参考にconfig.tomlを編集してください.
  4. 設定は以上です.あとはプルリクエストを作成してみてください.

注意

開発者の卒業に伴い,現在上記の方法でCLIONEを使うことはできません. CLIONEを利用したい場合,下記の「サーバとして使う」を参考にして自身のサーバを用意してください.

設定

similarityは整数型,それ以外は文字列型で記述してください.
tomlの例はこちら

名前 説明 デフォルト値
src ソースファイルを含むディレクトリへの相対パス
例: src/main/java
src
lang プログラミング言語.以下を選択できます.
java, kotlin, python, cpp
java
clone_detector クローン検出器.以下を選択できます.カッコ内は対応言語です.
NiCad(java, python, cpp),SourcererCC(java, kotlin, python, cpp)
NiCad
granularity 検出するクローンの粒度.以下を選択できます.
method,block
block
similarity 検出するクローンの類似度.0~10までの整数値dを入力すると,10*d%の類似度でクローンを検出します. 8

サーバとして使う

自身のサーバを立ててCLIONEを使えます

  1. https://developer.github.com/apps/ を参考にして,GitHub Appsを作成してください
  2. NiCadを使いたい場合,ここからTxlとNiCadをインストールしてください
  3. このリポジトリをクローンして,src/main/resources/github.propertiessrc/main/resources/verify.propertiessrc/main/resources/resource.propertiesに必要な情報を記載してください
  4. ./gradlew run (デフォルトポートは3000です)

単体ツールとして使う

CLIONEは単体ツールとしても利用できます. 過去のプルリクから対象のクローンを検出します.

  1. NiCadを使いたい場合,ここからTxlとNiCadをインストールしてください
  2. このリポジトリをクローンして,src/main/resources/stand_alone.propertiessrc/main/resources/resource.propertiesに必要な情報を記載してください.
    また,stand_alone.propertiesにsrcやlangなどの設定を記載してください
  3. ./gradlew standalone -Pargs = "user(or organization)_name/repo_name"

Cite

@inproceedings{clione,
         title = {CLIONE: Clone Modification Support for Pull Request Based Development},
        author = {Tasuku Nakagawa and Yoshiki Higo and Shinji Kusumoto},
     booktitle = {the 27th Asia-Pacific Software Engineering Conference (APSEC)},
         pages = {455-459},
         month = {12},
          year = {2020},
}

The paper is published here.

About

Code Clone Modification Support Bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages