-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refacotring: rename reduce to cross_file_process and pass the iterator
- Loading branch information
Showing
274 changed files
with
86,541 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
runtime: python27 | ||
api_version: 1 | ||
threadsafe: true | ||
|
||
handlers: | ||
- url: /favicon\.ico | ||
static_files: website/static/favicon.ico | ||
upload: website/static/favicon\.ico | ||
- url: / | ||
static_files: index.html | ||
upload: index.html | ||
- url: /website/static | ||
static_dir: website/static | ||
- url: /.* | ||
script: website.application | ||
|
||
libraries: | ||
- name: webapp2 | ||
version: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"""`appengine_config` gets loaded when starting a new application instance.""" | ||
import sys | ||
import os.path | ||
# add `lib` subdirectory to `sys.path`, so our `main` module can load | ||
# third-party libraries. | ||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib/local')) | ||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "lizard", | ||
"description": "lizard", | ||
"version": "0.0.0", | ||
"homepage": "https://github.com/terryyin/lizard", | ||
"license": "MIT", | ||
"private": true, | ||
"dependencies": { | ||
"angular": "1.2.x", | ||
"angular-mocks": "~1.2.x", | ||
"jquery": "1.10.2", | ||
"bootstrap": "~3.1.1", | ||
"angular-route": "~1.2.x", | ||
"angular-resource": "~1.2.x", | ||
"jquery": "1.10.2", | ||
"angular-animate": "~1.2.x" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="lizardApp"> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="website/static/bower/bootstrap/dist/css/bootstrap.css" /> | ||
<script src="website/static/bower/angular/angular.js"></script> | ||
<script src="website/static/controllers.js"></script> | ||
</head> | ||
<body style="padding-top: 70px;"> | ||
<!-- Fixed navbar --> | ||
<div class="navbar navbar-inverse" role="navigation"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> | ||
<span class="sr-only">Toggle navigation</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a href="/" class="nav-brand navbar-left"> | ||
<img src="website/static/img/logo.png" style="width:40px;" /> | ||
</a> | ||
<a class="navbar-brand" href="#"> | ||
Lizard <em>code complexity analyzer</em></a> | ||
|
||
</div> | ||
<div class="navbar-collapse collapse"> | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li><a href="#">Home</a></li> | ||
<li><a href="#try">Try Online</a></li> | ||
<li><a href="https://github.com/terryyin/lizard">github</a></li> | ||
<li><a href="https://pypi.python.org/pypi/lizard">Download</a></li> | ||
</ul> | ||
</div><!--/.nav-collapse --> | ||
</div> | ||
</div> | ||
<div class="container theme-showcase" role="main"> | ||
<div class="jumbotron"> | ||
<h1>Complex is better</h1> | ||
<p>Than complicated. It's OK to build very complex software, | ||
but you don't have to build it in a complicated way. Lizard is a | ||
free open source tool | ||
that analyse the complexity of your source code right away supporting many programming languages, without any extra setup. | ||
It also does code clone / copy-paste detection. | ||
</p> | ||
<p><a href="https://pypi.python.org/pypi/lizard" class="btn btn-primary btn-lg" role="button">Download »</a></p> | ||
</div> | ||
</div> | ||
<div class="row container center-block" ng-controller="SourceFormController as source" ng-submit="submit()"> | ||
<div class="col-md-6"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4><a id="try">Try Lizard in Your Browser</a></h4> | ||
</div> | ||
<div class="panel-body"> | ||
<form method="post" role="form" class="form-horizontal"> | ||
<div class="input-group"> | ||
<select ng-init="source.lang = source.lang || '.c'" | ||
ng-model="source.lang" class="form-control" ng-options="lang for lang in ['.c','.cpp','.java','.js', '.py', '.m','.h', '.rb', '.swift']" title="Language"> | ||
</select> | ||
<span class="input-group-btn"> | ||
<input type="submit" value="Analyse" class="btn btn-primary"> | ||
</span> | ||
</div> | ||
<div><textarea name="content" class="form-control" rows="10" ng-model="source.code" placeholder="Paste your source code here..."></textarea></div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-6"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4> | ||
{{progress}} | ||
</h4> | ||
</div> | ||
<div class="panel-body"> | ||
<span class="label label-info">File Type <span class="badge">{{result.filename}}</span></span> | ||
<span class="label label-info">Token Count <span class="badge">{{result.token_count}}</span></span> | ||
<span class="label label-info">NLOC <span class="badge">{{result.nloc}}</span></span> | ||
</div> | ||
<table class="table table-hover"> | ||
<tr> | ||
<th> Function Name </th> | ||
<th> NLOC </th> | ||
<th> Complexity </th> | ||
<th> Token # </th> | ||
<th> Parameter # </th> | ||
</tr> | ||
<tr ng-repeat="fun in result.function_list"> | ||
<td>{{fun.name}}</td> | ||
<td align=right>{{fun.nloc}}</td> | ||
<td align=right>{{fun.cyclomatic_complexity}}</td> | ||
<td align=right>{{fun.token_count}}</td> | ||
<td align=right>{{fun.parameter_count}}</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
<a href="https://github.com/terryyin/lizard"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a> | ||
<script src="website/static/bower/jquery/jquery.min.js"></script> | ||
<script src="website/static/bower/bootstrap/dist/js/bootstrap.min.js"></script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from flask import Flask, request, url_for, render_template | ||
from lizard import analyze_file | ||
import os | ||
app = Flask(__name__) | ||
app.config['DEBUG'] = True | ||
|
||
|
||
@app.route('/') | ||
def hello(): | ||
return render_template('index.html') | ||
|
||
|
||
@app.route('/analyse', methods=['POST']) | ||
def analyse(): | ||
return render_template('index.html', info=analyze_file.analyze_source_code("a.cpp", request.form['content'])) | ||
|
||
|
||
@app.errorhandler(404) | ||
def page_not_found(e): | ||
return 'Sorry, nothing at this URL.', 404 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
{% autoescape true %} | ||
<html> | ||
<body> | ||
|
||
<form action="{{ url_for('analyse') }}" method="post"> | ||
<div><textarea name="content" rows="30" cols="60"></textarea></div> | ||
<div><input type="submit" value="Analyse"></div> | ||
</form> | ||
|
||
{% if info %} | ||
<ul class=entries> | ||
{% for f in info.function_list %} | ||
<li><h2>{{ f.name }}</h2>{{ f.nloc }} | ||
{% else %} | ||
<li><em>Unbelievable. No entries here so far</em> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
</body> | ||
</html> | ||
{% endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import webapp2 | ||
import json | ||
from json import JSONEncoder | ||
class FileInfoEncoder(JSONEncoder): | ||
def default(self, o): | ||
return o.__dict__ | ||
from lizard import analyze_file | ||
|
||
class LizardAnalyzer(webapp2.RequestHandler): | ||
def post(self): | ||
dictionary = json.loads(self.request.body) | ||
file_info = analyze_file.analyze_source_code(dictionary.get("lang", ".c"), dictionary.get("code", "")) | ||
self.response.headers['Content-Type'] = 'application/json' | ||
self.response.write(json.dumps(file_info, cls=FileInfoEncoder)) | ||
|
||
application = webapp2.WSGIApplication([ | ||
('/analyze', LizardAnalyzer), | ||
], debug=True) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "angular-animate", | ||
"version": "1.2.18", | ||
"main": "./angular-animate.js", | ||
"dependencies": { | ||
"angular": "1.2.18" | ||
}, | ||
"homepage": "https://github.com/angular/bower-angular-animate", | ||
"_release": "1.2.18", | ||
"_resolution": { | ||
"type": "version", | ||
"tag": "v1.2.18", | ||
"commit": "cd5a97b990643e831802256cbfd3c39f0372fd3b" | ||
}, | ||
"_source": "git://github.com/angular/bower-angular-animate.git", | ||
"_target": "~1.2.x", | ||
"_originalSource": "angular-animate" | ||
} |
Oops, something went wrong.