Embed Instructions

93.43% of the project's source code conforms to the same coding conventions

  • Image URL
    https://squizlabs.github.io/PHP_CodeSniffer/analysis/chamilo/chamilo-lms/grade.svg
  • Markdown
    [![Code consistency](https://squizlabs.github.io/PHP_CodeSniffer/analysis/chamilo/chamilo-lms/grade.svg)](https://squizlabs.github.io/PHP_CodeSniffer/analysis/chamilo/chamilo-lms)
A-consistency

Analysis of Coding Conventions for Chamilo

PHP_CodeSniffer, using a custom coding standard and report, was used to record various coding conventions across 197 PHP projects.

Conventions

Analysis of Coding Conventions for Chamilo

Back to top

View project specific report

Project
Consistency

Class defined in namespace

Is each class defined in a namespace of at least 1 level?

This project is using the popular method for this convention

Current
Key Method Use
no no 45.34%
yes - Most popular method yes 54.66%

Based on 1,363 classes

Historical
  • 01 Mar 2015: there was a 41.99% swing from yes to no
  • 01 Apr 2015: there was a 3.36% swing from yes to no
  • 01 May 2015: there was a 18.07% swing from no to yes
  • 01 Jul 2015: there was a 3.51% swing from no to yes
  • 01 Nov 2015: there was a 4.42% swing from no to yes
  • 01 Dec 2015: there was a 12.4% swing from no to yes
  • 01 Jun 2016: there was a 5.08% swing from no to yes

Lowercase filename

Are PHP filenames lowercase?

Current
Key Method Use
no no 44.17%
yes - Most popular method yes 55.83%

Based on 2,214 files

Historical
  • 01 Mar 2015: there was a 14.72% swing from no to yes
  • 01 Apr 2015: there was a 8% swing from yes to no
  • 01 May 2015: there was a 10.17% swing from yes to no
  • 01 Dec 2015: there was a 7.6% swing from yes to no
  • 01 Jan 2016: there was a 4.26% swing from yes to no

Spacing after cast statement

How many spaces are there between a cast statement and the variable?

This project is using the popular method for this convention

Current
Key Method Use
0 - Most popular method 0 59.12%
1 1 40.75%
8 8 0.13%

Based on 795 cast statements

Historical
  • 01 Mar 2015: there was a 3.77% swing from 1 to 0
  • 01 Apr 2015: there was a 6.08% swing from 1 to 0
  • 01 May 2015: there was a 3.17% swing from 1 to 0

Array end comma

Does the last item end with a comma in a multi-line array definition?

Current
Key Method Use
no - Most popular method no 69.36%
yes yes 30.64%

Based on 1,002 array definitions

Historical
  • 01 Mar 2015: there was a 5.61% swing from yes to no
  • 01 Nov 2015: there was a 3.89% swing from no to yes
  • 01 Dec 2015: there was a 4.97% swing from no to yes
  • 01 Jan 2016: there was a 4.33% swing from no to yes

Spacing after string concat

How many spaces follow the string concatenation operator?

Current
Key Method Use
0 - Most popular method 0 70.28%
1 1 26.2%
newline newline 3.44%
Other other 0.08%

Based on 60,409 concat operators

Historical
  • 01 Jun 2016: there was a 3.76% swing towards 0

Spacing before string concat

How many spaces precede the string concatenation operator?

Current
Key Method Use
0 - Most popular method 0 72.27%
1 1 26.09%
newline newline 1.61%
Other other 0.03%

Based on 60,409 concat operators

Historical
  • 01 Jun 2016: there was a 3.98% swing from 1 to 0

CamelCase method name

Are class method names defined using CamelCase?

This project is using the popular method for this convention

Current
Key Method Use
no no 27.27%
yes - Most popular method yes 72.73%

Based on 12,550 methods

Historical
  • 01 Mar 2015: there was a 8.18% swing from yes to no
  • 01 May 2015: there was a 10% swing from no to yes
  • 01 Jun 2016: there was a 3.09% swing from no to yes

Space before operator

How many spaces precede comparison, arithmetic and assignment operators?

This project is using the popular method for this convention

Current
Key Method Use
0 0 26.64%
1 - Most popular method 1 72.88%
Other other 0.48%

Based on 37,976 operators

Historical
  • 01 Mar 2015: there was a 49.36% swing away from 0
    • there was a 48.99% swing towards 1

PascalCase class name

Are class names defined using PascalCase?

This project is using the popular method for this convention

Current
Key Method Use
no no 18.2%
yes - Most popular method yes 81.8%

Based on 1,363 classes

Historical
  • 01 Mar 2015: there was a 8.33% swing from yes to no
  • 01 May 2015: there was a 6.27% swing from no to yes
  • 01 Dec 2015: there was a 5.16% swing from no to yes

Short array syntax used

Are arrays defined using the PHP 5.4+ short array syntax?

Current
Key Method Use
no - Most popular method no 83.04%
yes yes 16.96%

Based on 17,521 array definitions

Historical
  • 01 May 2015: there was a 5.47% swing from no to yes

Use of ELSE IF or ELSEIF

Are elseif statements defined using elseif or else if?

This project is using the popular method for this convention

Current
Key Method Use
else if else if 15.25%
elseif - Most popular method elseif 84.75%

Based on 1,554 elseif statements

Historical
  • 01 Mar 2015: there was a 15.37% swing from else if to elseif
  • 01 Jun 2016: there was a 4.85% swing from else if to elseif

Adjacent assignments aligned

For a block of assignments, are the assignment operators (equals, plus-equals etc.) aligned?

This project is using the popular method for this convention

Current
Key Method Use
no - Most popular method no 85.48%
yes yes 14.52%

Based on 19,174 assignment blocks

Historical

Function opening brace placement

Is the opening brace of a function on the same line as the function keyword or the next line?

This project is using the popular method for this convention

Current
Key Method Use
new line - Most popular method new line 86.02%
same line same line 13.98%

Based on 14,194 functions

Historical
  • 01 Mar 2015: there was a 3.22% swing from new line to same line
  • 01 May 2015: there was a 7.13% swing from same line to new line
  • 01 Jun 2016: there was a 4.77% swing from same line to new line

Number of newlines at EOF

How many newline characters appear at the end of the file?

This project is using the popular method for this convention

Current
Key Method Use
0 0 8.38%
1 - Most popular method 1 86.78%
2 2 3.97%
Other other 0.87%

Based on 2,065 files

Historical
  • 01 Mar 2015: there was a 6.04% swing towards 0
    • there was a 5.82% swing away from 1
  • 01 Apr 2015: there was a 42.63% swing away from 0
    • there was a 41.08% swing towards 1
  • 01 May 2015: there was a 7.48% swing away from 0
    • there was a 7.71% swing towards 1

Inline comment style

What comment style is used for non docblock comments?

This project is using the popular method for this convention

Current
Key Method Use
# ... # ... 1%
/* ... */ /* ... */ 11.75%
// ... - Most popular method // ... 87.26%

Based on 28,898 inline comments

Historical
  • 01 Apr 2015: there was a 4.91% swing away from /* ... */
    • there was a 4.82% swing towards // ...

Declarations and side effects mixed

Do files both declare symbols (classes, functions, constants, etc.) and cause side-effects (e.g. generate output, change .ini settings, etc.)?

This project is using the popular method for this convention

Current
Key Method Use
no - Most popular method no 88.89%
yes yes 11.11%

Based on 2,214 files

Historical
  • 01 Apr 2015: there was a 8.22% swing from no to yes

Class opening brace placement

Is the opening brace of a class on the same line as the class keyword or the next line?

This project is using the popular method for this convention

Current
Key Method Use
new line - Most popular method new line 89.36%
same line same line 10.64%

Based on 1,363 classes

Historical
  • 01 Mar 2015: there was a 12.02% swing from new line to same line
  • 01 May 2015: there was a 5.5% swing from same line to new line
  • 01 Dec 2015: there was a 4.47% swing from same line to new line
  • 01 Jun 2016: there was a 6.57% swing from same line to new line

Function has doc comment

Does each function have a docblock comment to describe its purpose?

This project is using the popular method for this convention

Current
Key Method Use
no no 10.55%
yes - Most popular method yes 89.45%

Based on 14,356 functions

Historical
  • 01 May 2015: there was a 6.46% swing from no to yes

Line indent

Are lines indented using spaces or tabs?

This project is using the popular method for this convention

Current
Key Method Use
mixed mixed 0.69%
spaces - Most popular method spaces 90.07%
tabs tabs 9.24%

Based on 438,676 indented lines

Historical
  • 01 Mar 2015: there was a 5.19% swing towards spaces
    • there was a 5.26% swing away from tabs

Line length

Including whitespace and comments, how many characters are in non-empty code lines?

This project is using the popular method for this convention

Current
Key Method Use
80 or less - Most popular method 80 or less 90.37%
81-120 81-120 6.76%
121-150 121-150 1.18%
151 or more 151 or more 1.69%

Based on 743,639 lines

Historical

Private method prefixed with underscore

Are private methods prefixed with an underscore?

This project is using the popular method for this convention

Current
Key Method Use
no - Most popular method no 91.29%
yes yes 8.71%

Based on 241 private methods

Historical
  • 01 May 2015: there was a 7.43% swing from yes to no
  • 01 May 2016: there was a 3.18% swing from yes to no

File has doc comment

Does each PHP file have a docblock comment to describe its purpose?

This project is using the popular method for this convention

Current
Key Method Use
no no 8%
yes - Most popular method yes 92%

Based on 2,213 files

Historical
  • 01 Mar 2015: there was a 12.51% swing from no to yes
  • 01 Apr 2015: there was a 3.69% swing from yes to no

PHP closing tag at EOF

Is there a PHP closing tag at the end of the file?

This project is using the popular method for this convention

Current
Key Method Use
no - Most popular method no 92.55%
yes yes 7.45%

Based on 2,214 files

Historical
  • 01 Mar 2015: there was a 10.82% swing from no to yes
  • 01 Apr 2015: there was a 42.52% swing from yes to no
  • 01 May 2015: there was a 4.47% swing from yes to no

One class per file

Is each class defined in a file by itself?

This project is using the popular method for this convention

Current
Key Method Use
no no 7.34%
yes - Most popular method yes 92.66%

Based on 1,363 classes

Historical
  • 01 Mar 2015: there was a 5.36% swing from yes to no

Class has doc comment

Does each class have a docblock comment to describe its purpose?

This project is using the popular method for this convention

Current
Key Method Use
no no 7.26%
yes - Most popular method yes 92.74%

Based on 1,363 classes

Historical
  • 01 Mar 2015: there was a 4.72% swing from no to yes

Spacing before object operator

How many spaces precede the object operator (->)?

This project is using the popular method for this convention

Current
Key Method Use
0 - Most popular method 0 94.66%
1 1 3.27%
newline newline 2.07%

Based on 84,886 object operators

Historical

Control structure defined inline

Are control structures defined inline (without braces)?

This project is using the popular method for this convention

Current
Key Method Use
no - Most popular method no 95.31%
yes yes 4.69%

Based on 47,343 control structures

Historical

PHP constant case

What case are PHP constants (true, false, null) written in?

This project is using the popular method for this convention

Current
Key Method Use
lower - Most popular method lower 95.65%
mixed mixed 0.01%
upper upper 4.34%

Based on 22,151 PHP constants

Historical
  • 01 Mar 2015: there was a 4.09% swing from lower to upper
  • 01 Jan 2016: there was a 15.05% swing from upper to lower

Spaces after control structure open parenthesis

How many spaces follow the opening parenthesis of a control structure?

This project is using the popular method for this convention

Current
Key Method Use
0 - Most popular method 0 96.07%
1 1 3.49%
Other other 0.44%

Based on 40,141 control structures

Historical

Spacing after object operator

How many spaces follow the object operator (->)?

This project is using the popular method for this convention

Current
Key Method Use
0 - Most popular method 0 96.28%
1 1 3.72%

Based on 84,886 object operators

Historical

Closure opening brace placement

Is the opening brace of a closure on the same line as the function keyword or the next line?

This project is using the popular method for this convention

Current
Key Method Use
new line new line 3.45%
same line - Most popular method same line 96.55%

Based on 29 closures

Historical
  • 01 Jul 2015: there was a 33.33% swing from same line to new line
  • 01 Sep 2015: there was a 13.33% swing from new line to same line
  • 01 Dec 2015: there was a 16.3% swing from new line to same line

Space after operator

How many spaces follow comparison, arithmetic and assignment operators?

This project is using the popular method for this convention

Current
Key Method Use
0 0 2.53%
1 - Most popular method 1 97.22%
Other other 0.25%

Based on 354,762 operators

Historical
  • 01 Mar 2015: there was a 25.66% swing away from 0
    • there was a 25.52% swing towards 1

EOL char

What character is used for line breaks?

This project is using the popular method for this convention

Current
Key Method Use
\n - Most popular method \n 97.34%
\r\n \r\n 2.66%

Based on 2,214 files

Historical
  • 01 Mar 2015: there was a 4.12% swing from \r\n to \n

Blank lines at start of control structure

How many blank lines precede the body of a control structure?

This project is using the popular method for this convention

Current
Key Method Use
0 - Most popular method 0 98.04%
1 1 1.95%
2 2 0.01%
3 3 < 0.01%

Based on 45,246 control structures

Historical

Spaces before control structure close parenthesis

How many spaces precede the closing parenthesis of a control structure?

This project is using the popular method for this convention

Current
Key Method Use
0 - Most popular method 0 98.13%
1 1 1.86%
2 2 < 0.01%

Based on 40,141 control structures

Historical

Brackets around echoed strings

Are parenthesis placed around echo'd strings?

This project is using the popular method for this convention

Current
Key Method Use
no - Most popular method no 99.05%
yes yes 0.95%

Based on 6,746 echo statements

Historical

Blank lines at end of control structure

How many blank lines follow the body of a control structure?

This project is using the popular method for this convention

Current
Key Method Use
0 - Most popular method 0 99.26%
1 1 0.73%
2 2 0.01%

Based on 45,189 control structures

Historical

Multiple statements on same line

Are multiple statements defined on the same line of code?

This project is using the popular method for this convention

Current
Key Method Use
no - Most popular method no 99.44%
yes yes 0.56%

Based on 363,136 statements

Historical

PHP type case

What case are PHP types (int, bool, string) written in?

This project is using the popular method for this convention

Current
Key Method Use
lower - Most popular method lower 99.78%
mixed mixed 0.22%

Based on 895 PHP types

Historical

PHP keyword case

What case are PHP keywords (function, echo, foreach etc.) written in?

This project is using the popular method for this convention

Current
Key Method Use
lower - Most popular method lower 99.91%
mixed mixed < 0.01%
upper upper 0.09%

Based on 159,785 keywords

Historical

File extension for class files

For files that contain classes, what extension does the file use?

This project is using the popular method for this convention

Current
Key Method Use
.inc .inc 0.08%
.php - Most popular method .php 99.92%

Based on 1,263 class files

Historical

Constant name case

What case are user-defined constants defined in?

This project is using the popular method for this convention

Current
Key Method Use
lower lower 0.06%
upper - Most popular method upper 99.94%

Based on 1,669 constants

Historical

Array keyword case

When defining an array, how is the array keyword written?

This project is using the popular method for this convention

Current
Key Method Use
lower - Most popular method lower 99.99%
mixed mixed 0.01%

Based on 14,550 array definitions

Historical

CamelCase function name

Are global function names defined using CamelCase?

This project is using the popular method for this convention

Current
Key Method Use
no - Most popular method no 100%

Based on 1,233 global functions

Historical

PHP short open tag used

Is the PHP short open tag syntax used?

This project is using the popular method for this convention

Current
Key Method Use
no - Most popular method no 100%

Based on 17,636 open tags

Historical

File extension for non-class files

For files that do not contain classes, what extension does the file use?

This project is using the popular method for this convention

Current
Key Method Use
.php - Most popular method .php 100%

Based on 951 non-class files

Historical