Coder Social home page Coder Social logo

tomgu1991 / lupa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jetbrains-research/lupa

0.0 0.0 0.0 1.58 MB

A framework for the large scale analysis of programming language usage.

License: Apache License 2.0

Python 26.89% Kotlin 25.20% Jupyter Notebook 47.91%

lupa's Introduction

Lupa ๐Ÿ”

Kotlin build Python build

Lupa ๐Ÿ” is an extendable framework for analyzing fine-grained language usage on the base of the IntelliJ Platform. Lupa ๐Ÿ” is a command line tool that uses the power of the IntelliJ Platform under the hood to perform code analysis using the same industry-level tools that are employed in IntelliJ-based IDEs, such as IntelliJ IDEA, PyCharm, or CLion.

Currently, our framework supports analyzing two languages: Python --- a mature language most popular in data science and machine learning, and Kotlin --- a relatively young but quickly growing language.

How it works

Lupa ๐Ÿ” is a platform for large-scale analysis of the programming language usage. Specifically, Lupa ๐Ÿ” is implemented as a plugin for the IntelliJ Platform that reuses its API to launch the IDE in the background (without user interface) and run the necessary analysis on every project in the given dataset.

The main pipeline of Lupa ๐Ÿ” is demonstrated bellow:

An operating pipeline of the tool

To perform the analysis, the tool needs two obvious components: a dataset and analyzers, i.e., sets of instructions of what PSI tree nodes need to be analyzed and how. To get more information about data collection see the data_collection module. The repository contains several core-modules:

  • lupa-core - functions common to all modules and analyzers;
  • lupa-test - common tests' architecture for all modules;
  • lupa-runner - the module with runners for all analyzers;
  • scripts - common functionality for data gathering, processing and visualization (written in Python).

And several examples of analyzers that we used for our purposes:

  1. Kotlin's analysers:
    • clones - functionality related to clones analysis in Kotlin projects;
    • dependencies - functionality related to dependency analysis in Kotlin projects;
    • gradle - functionality related to code analysis of the Gradle files in Kotlin projects;
    • statistic - functionality related to different code analysis in Kotlin projects, like range analysis;
  2. Python's analysers:
    • callExpressions - functionality related to call expressions (functions, classes, decorators) analysis in Python projects;
    • imports - functionality related to imports analysis in Python projects.

To get more information see these modules (each of them has a README file).

Installation

Clone the repo by git clone https://github.com/nbirillo/Lupa.git.

For analyzers modules and core architecture you should have Kotlin at least 1.5.21 version. For functionality for data gathering, processing and visualization (scripts module) you should have Python 3+ and also run:

  • pip install -r scripts/requirements.txt
  • pip install -r scripts/requirements-test.txt - for tests (optional)
  • pip install -r scripts/requirements-code-style.txt - for code style checkers (optional)

Usage

  1. For analyzers:
  2. For functionality for data gathering, processing and visualization:

Contribution

Please be sure to review project's contributing guidelines to learn how to help the project.

lupa's People

Contributors

girz0n avatar nbirillo avatar annav1asova avatar tiginamaria avatar areyde avatar egor-bogomolov avatar konstantgr 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.