Giter VIP home page Giter VIP logo

stackoverflow-joern's Introduction

JoernAnalyzeStackOverflowCode

From stackoverflow get Q&A data, extract code and tags, then using joern tool get partial code AST and convert AST node type to text

  • how to use stackoverflow data
  • how to use joern to do code analyse, get AST/DDG/CFG,etc
  • how to write gremlin query to visit AST tree stored in Neo4j
  • how to convert AST to Text

Data source

Joern (a platform for robust analysis of C/C++ code)

Tips for install Joern

If you follow official guide strictly, you may still encounter some problems, so make sure the following steps:

  1. java version ,better 1.8
  2. Neo4J Server 2.1.5 Community Edition, if you can't find in it's official guide: wget http://dist.neo4j.org/neo4j-community-2.1.5-unix.tar.gz
  3. choose py2neo 2.0 when install python-joern, you can use this site: https://pypi.python.org/pypi/py2neo/2.0
  4. When istalling gremlin-plugin, you need do mvn clean package, if error occurs, you should change all of the license file data to 2017

Tips for using Joern

  1. Import your code correctly, following this: http://joern.readthedocs.io/en/latest/tutorials/unixStyleCodeAnalysis.html#importing-the-code
  2. When you need to start Neo4j, using this command in case of error:

    $NEO4J/bin/neo4j start-no-wait

  3. rm .joernIndex dir before doing a new import
  4. you can't update Neo4j when it's on running, you need to close it first

File introduce

  1. code_info some file of types/keyword of different language
  2. extrac_code_from_StackOverflow java code to get question and it's answers from database
  3. code_clean_utils.py tools to do cleaning for code and text
  4. get_AST_type_joern.py gremlin query to get AST node type from Neo4j
  5. stackoverflow_data_clean.py get training and testing dataset

If you think this project may helpful, may you give me a star? :)

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.