-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
383 lines (332 loc) · 16.3 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="The Karr Lab is a computational systems biology research lab at the Icahn School of Medicine at Mount Sinai." />
<meta name="keywords" content="Jonathan Karr, systems biology, translational medicine, whole-cell, modeling" />
<meta name="author" content="Jonathan Karr" />
<meta name="revised" content="Jonathan Karr, 03/03/2018" />
<meta name="copyright" content="© 2013-2018 Karr Lab" />
<meta name="robots" content="ALL" />
<meta http-equiv="content-language" content="en-US" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Karr Lab</title>
<link rel="stylesheet" href="https://www.karrlab.org/static/css/foundation.css" />
<link rel="stylesheet" href="https://www.karrlab.org/static/css/foundation-icons.css" />
<link rel="stylesheet" href="https://www.karrlab.org/static/css/extras.css" />
<script src="https://www.karrlab.org/static/js/vendor/modernizr.js"></script>
<link rel="icon" type="image/x-icon" href="https://www.karrlab.org/static/img/logo-mssm-16x16.ico" />
<style>
.row {
max-width: 80rem;
}
#code{
width:100%;
}
#code th {
background:#999;
}
#code th,
#code td {
text-align:center;
padding-left:2px;
padding-right:2px;
padding-top:4px;
padding-bottom:4px;
}
#code th:first-child,
#code td:first-child{
text-align:left;
whitespace: nowrap;
}
#code tr.margin th {
background:none;
height:30px;
}
#code tr.type th {
background:#d9d9d9
}
tr.alert td, tr.alert td a{
color:red;
}
a.alert {
color:red;
}
</style>
</head>
<body>
<div class="off-canvas-wrap" data-offcanvas>
<div class="inner-wrap">
<nav class="tab-bar hide-for-medium-up">
<section class="left-small">
<a class="left-off-canvas-toggle menu-icon" href="#"><span></span></a>
</section>
<section class="right tab-bar-section">
<h1 class="title">Karr Systems Biology Lab</h1>
</section>
</nav>
<aside class="left-off-canvas-menu">
<ul class="off-canvas-list">
<li><label>Karr Systems Biology Lab</label></li>
<li><a href="https://www.karrlab.org/">Home</a></li>
<li><a href="https://www.karrlab.org/research">Research</a></li>
<li><a href="https://www.karrlab.org/resources">Resources</a></li>
<li><a href="https://www.karrlab.org/publications">Publications</a></li>
<li><a href="https://www.karrlab.org/press">Press</a></li>
<li><a href="https://www.karrlab.org/funding">Funding</a></li>
<li><a href="https://www.karrlab.org/people">People</a></li>
<li><a href="https://www.karrlab.org/join">Join us</a></li>
<li><a href="https://www.karrlab.org/contact">Contact</a></li>
</ul>
</aside>
<section class="main-section">
<!-- canvas wrapping -->
<!-- top bar -->
<div class="top-bar row show-for-medium-up">
<div class="small-12 columns">
<dl class="sub-nav">
<dd><a href="https://www.karrlab.org/">Home</a></dd>
<dd><a href="https://www.karrlab.org/research">Research</a></dd>
<dd class="active"><a href="https://www.karrlab.org/resources">Resources</a></dd>
<dd><a href="https://www.karrlab.org/publications">Publications</a></dd>
<dd><a href="https://www.karrlab.org/press">Press</a></dd>
<dd><a href="https://www.karrlab.org/funding">Funding</a></dd>
<dd><a href="https://www.karrlab.org/people">People</a></dd>
<dd><a href="https://www.karrlab.org/join">Join us</a></dd>
<dd><a href="https://www.karrlab.org/contact">Contact</a></dd>
</dl>
</div>
</div>
<div class="top-bar-bg show-for-medium-up">
</div>
<!-- content -->
<div class="row content">
<div class="centered">
<!-- end common header -->
<h3>Code</h3>
<table cellpadding=0 cellspacing=0 id="code">
<thead>
<tr>
<th colspan="13"></th>
<th colspan="2">Downloads</th>
<th colspan="1"></th>
<th colspan="2">Latest commit</th>
<th colspan="1"></th>
</tr>
<tr>
<th>Package</th>
<th>Open?</th>
<th>License</th>
<th>Dist</th>
<th>Source</th>
<th>Docs</th>
<th>Build</th>
<th>Tests</th>
<th>Coverage</th>
<th>Analysis</th>
<th>Issues</th>
<th>Views</th>
<th>Clones</th>
<th>GitHub</th>
<th>Dist</th>
<th>Forks</th>
<th>Author</th>
<th>Date</th>
<th>Contributors</th>
</tr>
</thead>
<tbody>
<?php
error_reporting(E_ERROR);
ini_set('display_errors', 1);
require 'functions.php';
$types = get_package_types();
$pkg_configs = get_packages();
foreach ($types as $type) {
$pkg_ids = array_keys($pkg_configs[$type]);
sort($pkg_ids, SORT_NATURAL | SORT_FLAG_CASE);
if (count($pkg_ids) == 0) {
continue;
}
echo "<tr class='margin'><th colspan='19'></th></tr>\n";
echo "<tr class='type'><th colspan='19'>$type</th></tr>\n";
foreach ($pkg_ids as $pkg_id) {
$pkg = $pkg_configs[$type][$pkg_id];
if (property_exists($pkg, 'owner')){
$owner = $pkg->owner;
} else {
$owner = 'KarrLab';
}
$source = get_source_github($owner, $pkg->id, $cache);
if ($pkg->build && $pkg->build->circleci) {
$latest_build = get_latest_build_circleci($owner, $pkg->id, $cache)[0];
$artifacts = get_artifacts_circleci($owner, $pkg->id, $latest_build->build_num, $cache);
} else {
$latest_build = NULL;
$artifacts = array();
}
#start row
if ($pkg->build && $pkg->build->circleci && $latest_build->status != 'fixed' && $latest_build->status != 'success')
echo "<tr class='alert'>";
else
echo "<tr>";
#name
echo sprintf("<td><a href='https://github.com/%s/%s'>%s</a></td>\n", $owner, $pkg->id, $pkg->id);
#status
echo sprintf("<td>%s</td>\n", $pkg->availability);
#license
echo "<td>";
if ($pkg->license)
echo sprintf("<a href='https://github.com/%s/%s/blob/master/LICENSE'>%s</a>", $owner, $pkg->id, $pkg->license);
echo "</td>";
#distribution
echo "<td>";
if ($pkg->distribution) {
$dist_pkg_id = (property_exists($pkg->distribution, 'package') ? $pkg->distribution->package : $pkg->id);
switch ($pkg->distribution->repo) {
case 'pypi':
$distribution = get_latest_distribution_pypi($dist_pkg_id, $cache);
echo sprintf("<a href='https://pypi.python.org/pypi/%s'>%s</a>", $dist_pkg_id, $distribution->info->version);
break;
case 'ctan':
$distribution = get_latest_distribution_ctan($dist_pkg_id, $cache);
echo sprintf("<a href='https://www.ctan.org/pkg/%s'>%s</a>", $dist_pkg_id, $distribution->version->number);
break;
case 'bioportal':
$distribution = get_latest_distribution_bioportal($dist_pkg_id, $cache);
echo sprintf("<a href='http://bioportal.bioontology.org/ontologies/%s'>%s</a>", $dist_pkg_id, $distribution[0]->version);
break;
}
}
echo "</td>\n";
#source code
echo sprintf("<td><a href='https://github.com/%s/%s'>%s</a></td>\n",
$owner, $pkg->id, ($source['latest_tag'] ? $source['latest_tag'] : 'Latest'));
#documentation
echo "<td>";
if ($pkg->docs && $pkg->docs->readthedocs) {
$docs_url = "view_docs.php?package=".$pkg->id;
} elseif ($pkg->docs && $pkg->docs->url) {
$docs_url = "view_docs.php?package=".$pkg->id;
} elseif ($artifacts['docs']) {
$docs_url = "view_docs.php?package=".$pkg->id;
} else {
$docs_url = NULL;
}
if ($docs_url)
echo "<a href='$docs_url'>Latest</a>";
echo "</td>\n";
#build
echo "<td>";
if ($pkg->build && $pkg->build->circleci)
echo sprintf("<a href='https://circleci.com/gh/%s/%s'>%s</a>",
$owner, $pkg->id, ucfirst($latest_build->status));
echo "</td>\n";
#tests results
echo "<td>";
if ($pkg->test_results)
echo sprintf("<a href='https://tests.karrlab.org/%s/%s'>Results</a>", $owner, $pkg->id);
echo "</td>\n";
#coverage
echo "<td>";
if ($pkg->test_coverage && $pkg->test_coverage->coveralls) {
$coverage = get_coverage_coveralls($owner, $pkg->id, $pkg->test_coverage->coveralls->token, $cache);
echo sprintf("<a href='https://coveralls.io/github/%s/%s'>%.1f%%</a>", $owner, $pkg->id, $coverage->covered_percent);
} elseif ($pkg->test_coverage && $pkg->test_coverage->codecov) {
$coverage = get_coverage_codecov($owner, $pkg->id, $cache);
echo sprintf("<a href='https://codecov.io/gh/%s/%s'>%.1f%%</a>", $owner, $pkg->id, $coverage->commit->totals->c);
}
echo "</td>\n";
#analysis
echo "<td>";
if ($pkg->code_analysis && $pkg->code_analysis->code_climate){
if ($pkg->code_analysis->code_climate->open_source) {
$url = sprintf('https://codeclimate.com/github/%s/%s', $owner, $pkg->id);
$gpa = '';
} else {
$url = sprintf('https://codeclimate.com/repos/%s', $pkg->code_analysis->code_climate->token);
$analysis = get_analysis_codeclimate($pkg->code_analysis->code_climate->token, $cache);
$gpa = $analysis->last_snapshot->gpa;
}
echo sprintf("<a href='%s'>%s</a>", $url, $gpa);
}
echo "</td>\n";
#issues
echo sprintf("<td><a href='https://github.com/%s/%s/issues' class='%s'>%d</a> / <a href='https://github.com/%s/%s/issues?q='>%d</a></td>\n",
$owner,
$pkg->id, $source['issues']['needs-work'] > 0 ? 'alert' : '', $source['issues']['needs-work'],
$owner,
$pkg->id, $source['issues']['total']
);
#views
echo sprintf("<td><a href='https://github.com/%s/%s/graphs/traffic'>%d</a></td>\n",
$owner, $pkg->id, $source['views']);
#clones
echo sprintf("<td><a href='https://github.com/%s/%s/graphs/traffic'>%d</a></td>\n",
$owner, $pkg->id, $source['clones']);
#downloads
echo sprintf("<td><a href='https://github.com/%s/%s/graphs/traffic'>%d</a></td>\n",
$owner, $pkg->id, $source['downloads']);
echo "<td>";
if ($pkg->distribution && $pkg->distribution->repo == 'pypi') {
$dist_pkg_id = ($pkg->distribution->package ? $pkg->distribution->package : $pkg->id);
$downloads = 0;
foreach($distribution->releases as $release)
foreach($release as $file)
$downloads += $file->downloads;
echo sprintf("<a href='https://pypi.python.org/pypi/%s'>%d</a>", $pkg->id, $downloads);
}
echo "</td>\n";
#forks
echo sprintf("<td><a href='https://github.com/%s/%s/graphs/traffic'>%d</a></td>\n",
$owner, $pkg->id, $source['forks']);
#latest commit
echo sprintf("<td><a href='https://github.com/%s'>%s</a></td>\n",
$source['latest_commit']['author_login'], $source['latest_commit']['author_name']);
echo sprintf("<td><a href='https://github.com/%s/%s/tree/%s'>%s</a></td>\n",
$owner, $pkg->id, $source['latest_commit']['sha'],
strftime('%Y-%m-%d %H:%M', $source['latest_commit']['date']));
#contributors
echo sprintf("<td>%d</td>\n", $source['num_contributors']);
#end row
echo "</tr>\n";
echo "<tr>\n";
echo sprintf("<td colspan='19'>%s</td>\n", $pkg->description);
echo "</tr>\n";
}
}
$cache->commit();
?>
</tbody>
</table>
<!-- common footer -->
</div>
</div>
<!-- bottom bar -->
<div class="row bottom-bar">
<div class="logo">
<a href="https://www.mssm.edu"><img src="https://www.karrlab.org/static/img/logo-mssm-32x32.png" /></a>
</div>
<div class="text-left">
<a href="https://icahn.mssm.edu/departments-and-institutes/genomics">Icahn Institute for Genomics & Multiscale Biology</a><br/>
<a href="https://icahn.mssm.edu/departments-and-institutes/genomics">Department of Genetics & Genomic Sciences</a><br/>
<a href="https://www.mssm.edu">Icahn School of Medicine at Mount Sinai</a>
</div>
<div class="text-right show-for-medium-up">
© Karr Lab 2016
</div>
<div class="clear"></div>
</div>
<!-- canvas wrapping -->
</section>
<a class="exit-off-canvas"></a>
</div>
</div>
<script src="https://www.karrlab.org/static/js/vendor/jquery.js"></script>
<script src="https://www.karrlab.org/static/js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>