Giter Site home page Giter Site logo

code-quality-inspection's Introduction

Judge Girl

Judge Girl is under incubation and is actively developed (here to see the Scrum kanban). The document may be obsolete. Feel free to contact [email protected] or leave issues, open a thread in the discussions page if you are interested in any apsect.

Setup & Build

Clone the project (must include the submodule): git clone --recursive (This repository depends on the submodule Judge-Girl/Code-Quality-Inspection so the --recursive flag is needed)

  1. Rename application.example.yml, application-mysql.example.yml, application-mongo.example.yml and application-redis.example.yml under the Spring-Boot/Spring-Boot-Commons/src/main/resources/config/ folder to application.yml, application-mysql.yml, application-mongo.yml and application-redis.yml respectively, and then replace the PLACEHOLDERs in these files with the values to fit your need.
  2. Rename infra.example.yml to infra.yml and replace the PLACEHOLDERs with the values in the file to fit your need.

Run the entire Judge-Girl's backend locally

For those who wants to run all-in-one deployment locally, please do the following:

  1. Create a judge-girl network by docker network create judge-girl
  2. Run the infra component by docker-compose -f infra.yml
  3. Build and run the application by sh run.sh

Contributing

Contributions are welcome, especially 'software-design' nerds are welcomed to taste the practice of microservice/OOD/clean-architecture/domain-driven-design with us.

Thanks to all the people who already contributed!

Software Design (Clean Architecture/DDD)

This project is a taste of the practicality of (Topological) Microservice, Clean Architecture and Domain-Driven Design (DDD). Topological Microservice emphasizes that Judge-Girl should be capable of being deployed in a form of both monoliths or microservices. (Currently, we only support the microservices option)

Here are some overview introductions of our software design. For more details, please navigate to the docs/ folder.

Judge Girl follows clean-architecture and DDD. The package structure is based on four bounded context (Student, Problem, Submission, Academy) with three design forces (Domain Logic, Tech Stack, Client).

The following represents our primary package structure that practices clean architecture.

├── API (Force: Client)
│   ├── API-Commons
│   ├── Judger-API
│   ├── Student-API
│   ├── Problem-API
│   └── Submission-API
├── Domain (Force: Domain)
|   ├── Primitives 
│   ├── Student
│   ├── Problem
│   ├── Submission
│   └── Academy
├── Plugins
├── Dependencies (Maven dependencies)
├── Judger (Force: Online Judge System)
│   ├── CC-Profiler-Sandbox
│   └── Code-Quality-Inspection (Submodule)
└── Spring-Boot (Force: Tech Stack)
    ├── Spring-Boot-Commons
    ├── Spring-Boot-Academy
    ├── Spring-Boot-Problem
    ├── Spring-Boot-Student
    └── Spring-Boot-Submission

with 100% respect to the following diagram from Uncle Bob: Clean Architecture

Domain

In every domain package, there are application use cases (request + presenters), domain services and repositories. Every repository encapsulates the persistency of an aggregate root (e.g., Student/Problem/Submission) and every use case represents an application feature.

Tech Stack & System Architecture

image

Spring Boot is used to run our Judge Girl application.

Never write logs in the domain layer

We would log in technical layer (Controller, technical implementations, JPA, ...), but never in our domain layer. We use Aspect-Oriented Programming to inject logs into our domain layer.

Software Testing

Judge Girl is developed under E2E (API --> Database) test cases covering application usecases and Unit Test covering domain logic and utils. Where in our tests, RabbitMQ, MongoDB and MySQL are embedded.

code-quality-inspection's People

Contributors

chaoyuuu avatar edisonhello avatar giver139 avatar johnny850807 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

code-quality-inspection's Issues

Regex to find out string literals might cause stack overflow.

Since Java uses recursion to implement regex matching, the regex of matching string literals might cause the depth of the recursion to be the length of the string length, which might cause stack overflow for a long string literals.
Change the method of finding string literals by using loops to avoid stack overflow.

Enrich coding style checking report content

Description

Add some method to return more information from coding style checking.

  • What variable names violated naming style checking.
  • What variables violated global variable checking.
  • Maybe Generate a string from these information?
  • Tests.

Acceptance Criteria

Change variable naming style rule

Description

Keep current rules but

  1. reject single char name by default
  2. reads another whitelist token array to accept these token

Questions

  • How to receive tokens?
  • If whitelist is for token and we enable i, j, k:
    • i_j_k or jIK are valid.
  • If whitelist is for variable:
    • aGoodVariable will not be valid since a is rejected.

Acceptance Criteria

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.