Embed Instructions

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

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

Analysis of Coding Conventions for PrestaShop

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 PrestaShop

Back to top

View project specific report

Project
Consistency

Function has doc comment

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

Current
Key Method Use
no - Most popular method no 55.69%
yes yes 44.31%

Based on 6,568 functions

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
# ... # ... 10.22%
/* ... */ /* ... */ 31.5%
// ... - Most popular method // ... 58.28%

Based on 7,544 inline comments

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 70.18%
yes yes 29.82%

Based on 493 array definitions

Historical

Constant name case

What case are user-defined constants defined in?

Current
Key Method Use
mixed - Most popular method mixed 75.44%
upper upper 24.56%

Based on 1,702 constants

Historical

Lowercase filename

Are PHP filenames lowercase?

Current
Key Method Use
no no 22.7%
yes - Most popular method yes 77.3%

Based on 1,709 files

Historical
  • 01 Feb 2015: there was a 4.44% swing from no to yes

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

Based on 497 classes

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 87.7%
yes yes 12.3%

Based on 122 private methods

Historical

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.02%
spaces - Most popular method spaces 87.79%
tabs tabs 12.19%

Based on 170,051 indented lines

Historical
  • 01 Aug 2015: there was a 82.11% swing towards spaces
    • there was a 82% 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 88.18%
81-120 81-120 8.35%
121-150 121-150 1.96%
151 or more 151 or more 1.52%

Based on 235,528 lines

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 88.3%
yes yes 11.7%

Based on 5,206 assignment blocks

Historical
  • 01 Aug 2015: there was a 3.97% swing from yes to no

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 7.45%
1 - Most popular method 1 91.73%
2 2 0.29%
3 3 0.53%

Based on 1,705 files

Historical
  • 01 Feb 2015: there was a 8.98% swing away from 0
    • there was a 10.97% swing towards 1
  • 01 Apr 2015: there was a 3.75% swing towards 0
  • 01 Aug 2015: there was a 37.33% swing away from 0
    • there was a 40.93% swing towards 1

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 91.75%
yes yes 8.25%

Based on 1,709 files

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

Based on 1,709 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 92.63%
yes yes 7.37%

Based on 21,300 control structures

Historical
  • 01 Aug 2015: there was a 56.79% swing from yes to no

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

Based on 497 classes

Historical
  • 01 Jun 2015: there was a 5.17% swing from yes to no

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 4.6%
elseif - Most popular method elseif 95.4%

Based on 1,283 elseif statements

Historical
  • 01 Aug 2015: there was a 4.47% swing from else if to elseif

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 4.02%
1 - Most popular method 1 95.59%
Other other 0.39%

Based on 13,646 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 4.41%
yes - Most popular method yes 95.59%

Based on 6,060 methods

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 97.65%
Other other 2.35%

Based on 80,173 operators

Historical

Spacing after string concat

How many spaces follow the string concatenation operator?

Current
Key Method Use
0 - Most popular method 0 98.55%
1 1 0.38%
newline newline 1.07%

Based on 36,708 concat operators

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

Based on 497 classes

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 98.95%
\r\n \r\n 1.05%

Based on 1,709 files

Historical
  • 01 Feb 2015: there was a 4.13% swing from \r\n to \n
  • 01 Aug 2015: there was a 20.29% swing from \r\n to \n

Spacing before string concat

How many spaces precede the string concatenation operator?

Current
Key Method Use
0 - Most popular method 0 98.95%
1 1 0.34%
newline newline 0.71%

Based on 36,708 concat operators

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.64%
yes yes 0.36%

Based on 549 echo statements

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.86%
1 1 0.14%

Based on 19,806 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.88%
1 1 0.12%

Based on 19,805 control structures

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 99.88%
yes yes 0.12%

Based on 1,709 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.91%
same line same line 0.09%

Based on 6,381 functions

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 99.92%
1 1 0.08%

Based on 9,612 cast statements

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

Based on 80,377 object 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.92%
upper upper 0.08%

Based on 13,319 PHP constants

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.95%
yes yes 0.05%

Based on 11,332 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.96%
mixed mixed < 0.01%
upper upper 0.04%

Based on 75,760 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 99.97%
1 1 0.01%
newline newline 0.02%

Based on 18,840 control structures

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

Based on 9,665 PHP types

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 80,377 object operators

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

Based on 61,782 statements

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 4 closures

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 2,763 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 1,219 non-class files

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 11,326 array definitions

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

Based on 18,840 control structures

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

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

Based on 497 classes

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 490 class files

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

Based on 497 classes

Historical