Embed Instructions

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

  • Image URL
    https://squizlabs.github.io/PHP_CodeSniffer/analysis/joomla/joomla-cms/grade.svg
  • Markdown
    [![Code consistency](https://squizlabs.github.io/PHP_CodeSniffer/analysis/joomla/joomla-cms/grade.svg)](https://squizlabs.github.io/PHP_CodeSniffer/analysis/joomla/joomla-cms)
Aconsistency

Analysis of Coding Conventions for Joomla! 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 Joomla! CMS

Back to top

View project specific report

Project
Consistency

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 55.1%
yes yes 44.9%

Based on 8,367 assignment blocks

Historical
  • 01 Sep 2015: there was a 5% swing from no to yes

Array end comma

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

This project is using the popular method for this convention

Current
Key Method Use
no no 43.27%
yes - Most popular method yes 56.73%

Based on 349 array definitions

Historical
  • 01 Sep 2016: there was a 14.34% swing from no to yes
  • 01 Nov 2016: there was a 3.16% swing from no to yes

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.)?

Current
Key Method Use
no no 39.88%
yes - Most popular method yes 60.12%

Based on 2,801 files

Historical

Closure opening brace placement

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

Current
Key Method Use
new line - Most popular method new line 75.68%
same line same line 24.32%

Based on 37 closures

Historical
  • 01 Apr 2015: there was a 3.16% swing from new line to same line
  • 01 Feb 2016: there was a 3.64% swing from same line to new line

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 81.32%
yes yes 18.68%

Based on 273 private methods

Historical
  • 01 Dec 2015: there was a 3.37% swing from yes to no
  • 01 Aug 2016: there was a 6.16% swing from yes to no

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 2.87%
1 - Most popular method 1 92.97%
2 2 0.01%
newline newline 4.14%

Based on 27,238 concat operators

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 93.1%
81-120 81-120 5.8%
121-150 121-150 0.88%
151 or more 151 or more 0.22%

Based on 464,956 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 6.06%
yes - Most popular method yes 93.94%

Based on 10,171 methods

Historical

Lowercase filename

Are PHP filenames lowercase?

Current
Key Method Use
no no 5.32%
yes - Most popular method yes 94.68%

Based on 2,801 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 94.91%
yes yes 5.09%

Based on 1,865 classes

Historical

Line indent

Are lines indented using spaces or tabs?

Current
Key Method Use
mixed mixed 0.03%
spaces spaces 4.83%
tabs - Most popular method tabs 95.14%

Based on 403,562 indented lines

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 2.6%
1 - Most popular method 1 95.24%
newline newline 1.95%
Other other 0.21%

Based on 27,238 concat operators

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 95.47%
yes yes 4.53%

Based on 2,801 files

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

Based on 11,069 functions

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

Based on 1,865 classes

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

Based on 1,865 classes

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 2.8%
1 - Most popular method 1 96.77%
Other other 0.43%

Based on 21,462 operators

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 3.02%
elseif - Most popular method elseif 96.98%

Based on 1,455 elseif 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 1.68%
1 - Most popular method 1 97.07%
2 2 1.1%
3 3 0.14%

Based on 2,083 files

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.46%
/* ... */ /* ... */ 2.45%
// ... - Most popular method // ... 97.1%

Based on 25,179 inline comments

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.1%
1 1 < 0.01%
newline newline 2.89%

Based on 120,864 object operators

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 97.4%
same line same line 2.6%

Based on 10,766 functions

Historical

Spacing after cast statement

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

Current
Key Method Use
0 0 2.33%
1 - Most popular method 1 97.67%

Based on 4,245 cast statements

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.5%
yes - Most popular method yes 98.5%

Based on 1,865 classes

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
no no 1.25%
yes - Most popular method yes 98.75%

Based on 2,801 files

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 99.04%
yes yes 0.96%

Based on 32,960 control structures

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 99.09%
same line same line 0.91%

Based on 1,865 classes

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
1 - Most popular method 1 99.14%
Other other 0.86%

Based on 87,236 operators

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 99.48%
upper upper 0.52%

Based on 18,997 PHP constants

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 99.56%
1 1 0.36%
newline newline 0.08%

Based on 29,434 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.63%
1 1 0.37%

Based on 34,034 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.68%
1 1 0.31%
2 2 < 0.01%
3 3 < 0.01%

Based on 29,434 control structures

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.76%
1 1 0.24%

Based on 34,023 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.8%
yes yes 0.2%

Based on 10,587 echo 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.96%
yes yes 0.04%

Based on 110,096 statements

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.98%
yes yes 0.02%

Based on 9,468 array definitions

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.98%
mixed mixed < 0.01%
upper upper 0.02%

Based on 134,006 keywords

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 99.99%
1 1 0.01%

Based on 120,864 object operators

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 2,801 files

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

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 4,498 PHP types

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 56,388 open tags

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

Based on 298 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 100%

Based on 9,466 array definitions

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 1,002 non-class files

Historical