Skip to content

Commit

Permalink
Add Pico code statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
PhrozenByte committed Oct 12, 2017
1 parent 5cb80e2 commit 138b2bd
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 9 deletions.
10 changes: 10 additions & 0 deletions _data/clocCore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PHP:
nFiles: 6
blank: 226
comment: 1122
code: 1020
SUM:
blank: 226
code: 1020
comment: 1122
nFiles: 6
40 changes: 40 additions & 0 deletions _data/clocRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
PHP:
nFiles: 10
blank: 273
comment: 1464
code: 1247
Markdown:
nFiles: 8
blank: 194
comment: 0
code: 757
CSS:
nFiles: 2
blank: 49
comment: 43
code: 299
Twig:
nFiles: 1
blank: 7
comment: 0
code: 49
JSON:
nFiles: 1
blank: 0
comment: 0
code: 44
Apache config:
nFiles: 1
blank: 2
comment: 3
code: 12
Javascript:
nFiles: 1
blank: 0
comment: 3
code: 1
SUM:
blank: 525
code: 2409
comment: 1513
nFiles: 24
54 changes: 54 additions & 0 deletions _includes/cloc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<div class="table-responsive">
<table>
<thead>
<tr>
<th style="width: 100%;">Language</th>
<th class="nowrap">Number of files</th>
<th class="nowrap">Blank lines</th>
<th class="nowrap">Comment lines</th>
<th class="nowrap">Code lines</th>
</tr>
</thead>
<tbody>
{% for item in cloc %}
{% if item[0] != "SUM" %}
<tr>
<td>{{ item[0] }}</td>
<td class="align-right nowrap">{{ item[1].nFiles }}</td>
<td class="align-right nowrap">{{ item[1].blank }}</td>
<td class="align-right nowrap">{{ item[1].comment }}</td>
<td class="align-right nowrap">{{ item[1].code }}</td>
</tr>
{% else %}
<tr>
<td></td>
<td class="nowrap">
<span class="amount small">
<span>#</span>
{{ item[1].nFiles }}
</span>
</td>
<td class="nowrap">
<span class="amount small">
<span>#</span>
{{ item[1].blank }}
</span>
</td>
<td class="nowrap">
<span class="amount small">
<span>#</span>
{{ item[1].comment }}
</span>
</td>
<td class="nowrap">
<span class="amount">
<span>#</span>
{{ item[1].code }}
</span>
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
21 changes: 21 additions & 0 deletions stats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
layout: default
title: Code Statistics
headline: Code Statistics
description: Pico's code statistics are powered by [cloc](https://github.com/AlDanial/cloc).
nav-url: /docs/
---

## Pico's core

The following table shows code statistics for Pico's core in the version of the latest release, without all non-essential additions (like the `PicoDeprecated` plugin or Pico's default theme).

{% assign cloc = site.data.clocCore %}
{% include cloc.html %}

## Release package

The following table shows code statistics of everything that is shipped in Pico's latest release package, including all recommended additions.

{% assign cloc = site.data.clocRelease %}
{% include cloc.html %}
58 changes: 50 additions & 8 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2677,22 +2677,26 @@ media_tag_5 {media_subcode:5}
.amount {
font-size: 40px;
padding: 10px 0;
font-weight: 900;
color: #ff6760;
}
.amount span:before {
display: none;
}
.amount span {
vertical-align: super;
font-size: 20px;
}
.amount.small {
font-size: 16px;
}
.amount.small span {
font-size: 10px;
}
.pricing .plan h4 {
padding: 0 0 10px;
background: #f6f6f6;
}
.pricing .plan h4 span {
font-weight: 900;
color: #ff6760;
}
.pricing .plan h4 span:before {
display: none
}
/*-----------------------------------------------------------------------------------*/
/* TWITTER
/*-----------------------------------------------------------------------------------*/
Expand Down Expand Up @@ -2989,10 +2993,48 @@ media_tag_5 {media_subcode:5}
-moz-box-shadow: 0 0 3px 0 rgba(0,0,0,0.17);
box-shadow: 0 0 3px 0 rgba(0,0,0,0.17);
}

/*-----------------------------------------------------------------------------------*/
/* TABLE
/*-----------------------------------------------------------------------------------*/
table {
border-spacing: 0;
width: 100%;
margin-bottom: 20px;
}
tr:nth-child(2n) {
background: #f6f6f6;
}
td, th {
padding: 0.4em 1em;
vertical-align: top;
}
th {
font-size: 16px;
font-weight: 900;
text-align: center;
text-transform: uppercase;
color: #616161;
background: #f6f6f6;
line-height: 45px;
margin: 0;
}
td, th { border: 1px solid #e9e9e9; }
tr:not(:last-child) td, tr:not(:last-child) th { border-bottom: 0 none; }
thead tr:last-child th { border-bottom: 0 none; }
td:not(:last-child), th:not(:last-child) { border-right: 0 none; }
.table-responsive {
overflow-x: auto;
margin-bottom: 20px;
}
.table-responsive > table { margin-bottom: 0; }
/*-----------------------------------------------------------------------------------*/
/* MISC
/*-----------------------------------------------------------------------------------*/
.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.align-justify { text-align: justify; }
.nowrap { white-space: nowrap; }
.hosted-price { font-size: 20px; }
.hosted-price span {
font-size: 30px;
Expand Down
2 changes: 1 addition & 1 deletion style/css/color/pico.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ ul.contact-info li i {
.meter > span {
background-color: #2EAE9B;
}
.pricing .plan h4 span {
.amount {
color: #2EAE9B;
}
.portfolio-detail-view .closebutton:hover,
Expand Down

0 comments on commit 138b2bd

Please sign in to comment.