Embed Instructions

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

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

Analysis of Coding Conventions for SilverStripe Framework

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 SilverStripe Framework

Back to top

View project specific report

Project
Consistency

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 46.06%
elseif - Most popular method elseif 53.94%

Based on 343 elseif statements

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 27.43%
1 - Most popular method 1 62.29%
newline newline 9.96%
Other other 0.32%

Based on 2,851 concat 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 62.67%
yes yes 37.33%

Based on 75 array definitions

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

Based on 452 classes

Historical

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 26.13%
1 - Most popular method 1 69.24%
2 2 0.11%
newline newline 4.52%

Based on 2,851 concat operators

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

Based on 4,324 methods

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 72%
upper upper 28%

Based on 4,836 PHP constants

Historical

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 73.11%
1 1 26.89%

Based on 238 cast statements

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

Based on 4,589 functions

Historical

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

Based on 452 classes

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 79.45%
yes yes 20.55%

Based on 8,388 control structures

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 3.6%
1 - Most popular method 1 80.06%
2 2 11.36%
3 3 4.71%
Other other 0.28%

Based on 361 files

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 11.6%
1 - Most popular method 1 86.06%
2 2 0.07%
newline newline 2.28%

Based on 4,614 operators

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 86.49%
yes yes 13.51%

Based on 2,258 assignment blocks

Historical

File has doc comment

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

Current
Key Method Use
no - Most popular method no 87.53%
yes yes 12.47%

Based on 361 files

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 90%
yes yes 10%

Based on 10 private methods

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 90.86%
yes yes 9.14%

Based on 361 files

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.83%
81-120 81-120 6.99%
121-150 121-150 0.02%
151 or more 151 or more 0.16%

Based on 91,527 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
/* ... */ /* ... */ 4.69%
// ... - Most popular method // ... 95.31%

Based on 3,750 inline comments

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 95.75%
1 1 3.85%
newline newline 0.4%

Based on 7,193 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 95.88%
yes yes 4.12%

Based on 23,244 statements

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 2.39%
1 - Most popular method 1 97.36%
2 2 0.1%
newline newline 0.16%

Based on 21,613 operators

Historical

Class opening brace placement

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

Current
Key Method Use
new line new line 2.43%
same line - Most popular method same line 97.57%

Based on 452 classes

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 97.58%
1 1 2.42%

Based on 7,193 control structures

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 98.06%
yes yes 1.94%

Based on 361 files

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

Based on 452 classes

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 98.93%
1 1 1.04%
2 2 0.03%

Based on 6,710 control structures

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.21%
1 1 0.79%

Based on 6,713 control structures

Historical

Function opening brace placement

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

Current
Key Method Use
new line new line 0.78%
same line - Most popular method same line 99.22%

Based on 4,463 functions

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 99.24%
newline newline 0.76%

Based on 19,534 object operators

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.31%
mixed mixed 0.69%

Based on 2,450 array definitions

Historical

Line indent

Are lines indented using spaces or tabs?

Current
Key Method Use
mixed mixed 0.09%
spaces spaces 0.59%
tabs - Most popular method tabs 99.33%

Based on 79,421 indented lines

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.62%
mixed mixed 0.38%

Based on 264 PHP types

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

Based on 351 class files

Historical

Class defined in namespace

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

Current
Key Method Use
no - Most popular method no 99.78%
yes yes 0.22%

Based on 452 classes

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.94%
mixed mixed 0.05%
upper upper < 0.01%

Based on 34,363 keywords

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

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

Based on 79 constants

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 212 echo statements

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

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

Based on 361 files

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

Based on 2,450 array definitions

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

Based on 54 closures

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 19,534 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 11 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 361 files

Historical