Skip to content

RepoScope – A microscope for your repositories

License

Notifications You must be signed in to change notification settings

SuhruthY/RepoScope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RepoScope

RepoScope is a Spring Boot application designed to analyze a Git repository and provide insights into its structure, such as the number of classes, methods, interfaces, abstract classes, and usage of loops and conditionals. It provides a simple REST API to analyze a repository by cloning it and analyzing its Java files.

Features

  • Clone a repository from a given URL.
  • Analyze Java files for classes, interfaces, and abstract classes.
  • Count the number of methods and detect loops and conditionals within methods.
  • Expose the analysis results via a REST API.

Prerequisites

  • Java 8 or later
  • Maven 3.6 or later
  • Git
  • An IDE or command-line tools to run Spring Boot applications

Setup and Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/yourusername/RepoScope.git
  2. Navigate to the project directory:

    cd RepoScope
  3. Build the project using Maven:

    mvn clean install
  4. Run the application:

    mvn spring-boot:run

Usage

Once the application is running, you can use the following API endpoint to analyze a repository:

Analyze Repository

  • Endpoint: GET /api/repo/analyze
  • Parameters: repoUrl (URL of the Git repository you want to analyze)
  • Response: A JSON object containing repository analysis data.

Example Request:

curl "http://localhost:8080/api/repo/analyze?repoUrl=https://github.com/spring-projects/spring-boot.git"

Example Response:

{
  "status": "success",
  "data": {
    "repositoryInfo": {
      "repoName": "spring-boot"
    },
    "classDetails": [
      {
        "className": "Application",
        "type": "Regular Class",
        "methods": [
          {
            "name": "main",
            "containsLoops": false,
            "containsConditionals": false
          }
        ]
      }
    ],
    "methodCalls": [
      {
        "caller": "main",
        "calledMethod": "run"
      }
    ],
    "loopsAndConditionals": [],
    "summary": {
      "abstractClasses": 0,
      "interfaces": 0,
      "methodWithLoops": 0,
      "methodWithConditionals": 0
    }
  }
}

Dependencies

This project uses the following dependencies:

  • Spring Boot
  • JGit
  • JavaParser
  • SLF4J (for logging)

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

RepoScope – A microscope for your repositories

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages