Embed Instructions

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

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

Analysis of Coding Conventions for Contao Open Source CMS

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 Contao Open Source CMS

Back to top

View project specific report

Project
Consistency

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 45.74%
yes - Most popular method yes 54.26%

Based on 564 classes

Historical

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 54.26%
same line same line 45.74%

Based on 564 classes

Historical

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 45.04%
yes - Most popular method yes 54.96%

Based on 564 classes

Historical

Spacing after cast statement

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

Current
Key Method Use
0 0 44.72%
1 - Most popular method 1 55.28%

Based on 161 cast statements

Historical

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 40.3%
1 - Most popular method 1 59.64%
2 2 0.01%
newline newline 0.04%

Based on 13,365 operators

Historical

Spacing before string concat

How many spaces precede the string concatenation operator?

This project is using the popular method for this convention

Current
Key Method Use
0 0 39.33%
1 - Most popular method 1 59.75%
newline newline 0.92%

Based on 10,277 concat 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 39.47%
same line - Most popular method same line 60.53%

Based on 38 closures

Historical
  • 01 Jul 2015: there was a 6.82% swing from same line to new line
  • 01 Oct 2016: there was a 5.26% swing from same line to new line
  • 01 Dec 2016: there was a 5.18% swing from same line to new line

Spacing after string concat

How many spaces follow the string concatenation operator?

This project is using the popular method for this convention

Current
Key Method Use
0 0 37.29%
1 - Most popular method 1 62.41%
2 2 0.06%
newline newline 0.24%

Based on 10,277 concat operators

Historical

Lowercase filename

Are PHP filenames lowercase?

This project is using the popular method for this convention

Current
Key Method Use
no - Most popular method no 73.33%
yes yes 26.67%

Based on 360 files

Historical

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 83.96%
yes yes 16.04%

Based on 2,045 assignment blocks

Historical

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 85%
yes yes 15%

Based on 360 files

Historical

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 14.77%
1 - Most popular method 1 85.15%
2 2 0.03%
newline newline 0.05%

Based on 36,428 operators

Historical

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 9.57%
yes - Most popular method yes 90.43%

Based on 564 classes

Historical

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 9.4%
yes - Most popular method yes 90.6%

Based on 564 classes

Historical

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 92.79%
81-120 81-120 5.37%
121-150 121-150 0.82%
151 or more 151 or more 1.02%

Based on 102,945 lines

Historical

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 4.87%
yes - Most popular method yes 95.13%

Based on 1,806 methods

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 97.41%
yes yes 2.59%

Based on 8,376 control structures

Historical

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 97.88%
1 1 0.02%
newline newline 2.11%

Based on 25,281 object operators

Historical

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 98.79%
yes yes 1.21%

Based on 165 array definitions

Historical

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 98.89%
yes yes 1.11%

Based on 360 files

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 99.01%
same line same line 0.99%

Based on 2,027 functions

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.83%
upper - Most popular method upper 99.17%

Based on 121 constants

Historical

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 0.72%
yes - Most popular method yes 99.28%

Based on 2,088 functions

Historical

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 0.58%
elseif - Most popular method elseif 99.42%

Based on 513 elseif statements

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.67%
yes yes 0.33%

Based on 21,504 statements

Historical

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 0.28%
1 - Most popular method 1 99.72%

Based on 356 files

Historical

Line indent

Are lines indented using spaces or tabs?

Current
Key Method Use
mixed mixed 0.02%
spaces spaces 0.16%
tabs - Most popular method tabs 99.82%

Based on 89,081 indented lines

Historical

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
# ... # ... 0.11%
/* ... */ /* ... */ 0.02%
// ... - Most popular method // ... 99.87%

Based on 5,274 inline comments

Historical

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 99.95%
1 1 0.05%

Based on 8,247 control structures

Historical

Short array syntax used

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

Current
Key Method Use
no - Most popular method no 99.96%
yes yes 0.04%

Based on 4,956 array definitions

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.96%
1 1 0.04%

Based on 8,243 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 99.99%
1 1 0.01%

Based on 7,735 control structures

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
.php - Most popular method .php 100%

Based on 306 class files

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 583 open tags

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 100%

Based on 4,544 PHP constants

Historical

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
yes - Most popular method yes 100%

Based on 360 files

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 54 non-class files

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 100%

Based on 29,415 keywords

Historical

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 100%

Based on 7,735 control structures

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 100%

Based on 4,954 array definitions

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 100%

Based on 252 PHP types

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 100%

Based on 59 echo statements

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 100%

Based on 11 private methods

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 100%

Based on 25,281 object operators

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 49 global functions

Historical

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 100%

Based on 360 files

Historical