Giter VIP home page Giter VIP logo

codecheck's Introduction

Code Check

Do you have a problem with duplicated functions in your java project? Here is the solution on how to find all the duplicate functions, specify the location of your repository in the local-config.properties file (just make a copy of config.properties) and run the code! Then you will get a file in "results" with all the places where functions match.

There are even some extra features such as

  • query an LLM on complicated situations where 2 functions could be similar
  • lots of configuration
  • it even has testing for it!

Testing

Manually

To run the tests run this command:

./gradlew test

Setting up pre-commit testing

If you want the tests to run when you commit code (to be sure it's working), you can install this hook locally.

To skip using it once, use -n or --no-verify when committing. E.g. git commit -nm "[commit message]"

Install Hook

cp pre-commit.tests .git/hooks/pre-commit
chmod u+x .git/hooks/pre-commit

Uninstall Hook

rm .git/hooks/pre-commit

Getting started with the large language model (LLM)

Download the language model

Setting up the configuration

Add model and set the configuration to use LLM

  1. Move the downloaded LLM into a new folder called model in the main repository.
  2. In config.properties, set LLM_FILE to the name of your downloaded model (e.g. model/ggml-model-gpt4all-falcon-q4_0.bin).
  3. In config.properties, set RUN_WITH_LLM to true.

Usage

Run Main.java in the project.

Results

The results will be shown in the /results/ folder. By default, the result naming is result_{nr} where {nr} is represented by a number that increases for each execution.

Configuration file

You can edit some configuration in config.properties.

Properties

Property Default values if not set (if not required) Type Description
LOGGING_LEVEL INFO String Which level to show the logging in.
PATH_TO_CODE src/test/resources/ String Required attribute. Where the code is located.
PATH_TO_RESULTS results String Results directory.
RESULT_NAME_PREFIX result_{nr} String Result name. {nr} will be replaced by an incremental number.
RESULTS_FILE_LIMIT 100 Integer Since it's creating a new file each run, there is a limit.
EXCLUDED_PATHS [] List Separated by commas. Files/Paths to exclude during a run.
RUN_WITH_LLM false String Whether to use LLM during the run or not.
LLM_FILE models/ggml-model-gpt4all-falcon-q4_0.bin String If running with LLM, this has to be set linking to a model.
LLM_THREADS 4 Integer How many threads the LLM will be using.
TEMP_FILE_ENABLED false Boolean Whether to use a temporary file.
TEMP_FILE debugFile.txt String Where the temporary file is located.

LOGGING_LEVEL

The different options are the following:

ERROR WARNING INFO DEBUG TRACE
OFF/NONE
ERROR X
WARNING X X
INFO X X X
DEBUG X X X X
TRACE X X X X X

codecheck's People

Contributors

livila avatar fekozma avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.