1.Create a virtual environment $ py -m venv env
and activate it by $ .\env\Scripts\activate
2.In the environment install the following libraries(flask, scikit-learn, lizard, numpy, pandas).
3.Change in app.py to the csv file in which output should be taken.
4.Run$ python app.py
- flask
- sklearn
- lizard
- numpy
- pandas
- app.py: Flask app
- code_review.py: Genrating Halstead Metrics and Cyclomatic Complexity
- predict_code.py: For giving output as good or bad using trained model
- app.py renders the HTML and CSS UI and handles the routing og templates.
- app.py calls main() function in code_review.py which returns the features of user code.
- code_review.py uses codeparams functions to calculate halstead metrics and Mccabe Cyclomatic complexity.
- After calculating code parameters app.py call arr_input() from predictcode.py.
- arr_input() predicts the output based on the code metrices.
- In arr_input() function saved trained model is stored in form .sav and we use it for prediction.