Embed Instructions

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

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

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

Back to top

View project specific report

Project
Consistency

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

Based on 62 classes

Historical
  • 01 Mar 2018: there was a 50.82% swing from no to yes

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
# ... # ... 27.92%
/* ... */ /* ... */ 3.99%
// ... - Most popular method // ... 68.09%

Based on 351 inline comments

Historical
  • 01 Sep 2015: there was a 4.54% swing towards # ...
    • there was a 4.98% swing away from // ...
  • 01 Dec 2015: there was a 25.84% swing away from # ...
    • there was a 6.95% swing towards /* ... */
    • there was a 18.88% swing towards // ...
  • 01 Mar 2018: there was a 12.22% swing away from /* ... */
    • there was a 10.07% swing towards // ...

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 77.3%
yes yes 22.7%

Based on 141 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 20.05%
yes - Most popular method yes 79.95%

Based on 414 functions

Historical
  • 01 Dec 2015: there was a 5.85% swing from no to yes
  • 01 Mar 2018: there was a 59.65% swing from no to yes

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 87.88%
yes yes 12.12%

Based on 33 array definitions

Historical
  • 01 Dec 2015: there was a 19.05% swing from no to yes
  • 01 Mar 2018: there was a 6.93% swing from yes to no

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 89.36%
yes yes 10.64%

Based on 141 files

Historical
  • 01 Mar 2018: there was a 5% swing from no to yes

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 89.88%
1 1 9.5%
newline newline 0.62%

Based on 642 control structures

Historical
  • 01 Mar 2016: there was a 10.66% swing from 1 to 0
  • 01 Mar 2018: there was a 10.84% swing away from 0
    • there was a 10.36% swing towards 1

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 90.09%
newline newline 9.91%

Based on 2,784 object operators

Historical
  • 01 Mar 2018: there was a 3.73% swing from 0 to newline

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 0.2%
1 - Most popular method 1 90.87%
newline newline 8.92%

Based on 493 operators

Historical
  • 01 Dec 2015: there was a 4.08% swing from 1 to 0
  • 01 Mar 2018: there was a 4.85% swing away from 0
    • there was a 8.92% swing towards newline
    • there was a 4.08% swing away from 1

Adjacent assignments aligned

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

Current
Key Method Use
no no 8.38%
yes - Most popular method yes 91.62%

Based on 167 assignment blocks

Historical
  • 01 Mar 2018: there was a 63.19% swing from no to yes

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

Based on 15 constants

Historical
  • 01 Dec 2015: there was a 100% swing from upper to lower
  • 01 Mar 2018: there was a 93.33% swing from lower to upper

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.2%
yes - Most popular method yes 93.8%

Based on 274 methods

Historical
  • 01 Dec 2015: there was a 7.06% swing from no to yes

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 95.31%
81-120 81-120 4.5%
121-150 121-150 0.17%
151 or more 151 or more 0.03%

Based on 11,953 lines

Historical

Short array syntax used

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

This project is using the popular method for this convention

Current
Key Method Use
no no 3.64%
yes - Most popular method yes 96.36%

Based on 577 array definitions

Historical
  • 01 Mar 2018: there was a 96.36% swing from no to yes

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 97.55%
1 1 2.45%

Based on 694 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 1.94%
1 - Most popular method 1 98.06%

Based on 103 files

Historical
  • 01 Mar 2016: there was a 45.36% swing from 0 to 1

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 0%
1 - Most popular method 1 99.83%
newline newline 0.17%

Based on 593 concat operators

Historical
  • 01 Dec 2015: there was a 5.26% swing from 0 to 1
  • 01 Mar 2018: there was a 10.05% swing from 0 to 1

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 0%
1 - Most popular method 1 99.83%
newline newline 0.17%

Based on 593 concat operators

Historical
  • 01 Dec 2015: there was a 3.6% swing away from 0
    • there was a 4.58% swing towards 1
  • 01 Mar 2018: there was a 10.22% swing towards 1
    • there was a 10.05% swing away from 0

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.85%
yes yes 0.15%

Based on 677 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.97%
yes yes 0.03%

Based on 3,268 statements

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 164 PHP constants

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

Historical

Line indent

Are lines indented using spaces or tabs?

This project is using the popular method for this convention

Current
Key Method Use
spaces - Most popular method spaces 100%
tabs tabs 0%

Based on 9,563 indented lines

Historical
  • 01 Dec 2015: there was a 17.23% swing from tabs to spaces
  • 01 Mar 2016: there was a 62.24% swing from tabs to spaces
  • 01 Jul 2016: there was a 4.25% swing from tabs to spaces
  • 01 Mar 2018: there was a 15.2% swing towards spaces
    • there was a 15.1% swing away from tabs

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

Based on 2,784 object operators

Historical

Lowercase filename

Are PHP filenames lowercase?

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

Based on 141 files

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

Based on 16 elseif statements

Historical
  • 01 Jul 2015: there was a 4.94% swing from else if to elseif
  • 01 Dec 2015: there was a 11.38% swing from else if to elseif
  • 01 Mar 2016: there was a 53.33% swing from else if to elseif

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

Based on 694 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 100%
same line same line 0%

Based on 62 classes

Historical
  • 01 Mar 2016: there was a 98.31% swing from same line to new line

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 642 control structures

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

Based on 62 classes

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 62 classes

Historical

PascalCase class name

Are class names defined using PascalCase?

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

Based on 62 classes

Historical
  • 01 Mar 2016: there was a 54.24% swing from yes to no

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 100%
same line same line 0%

Based on 412 functions

Historical
  • 01 Dec 2015: there was a 11.2% swing from same line to new line
  • 01 Mar 2016: there was a 88.8% swing from same line to new line

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

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 3,929 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 3,366 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 62 class 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 100%

Based on 9 private methods

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 21 array definitions

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

Based on 9 cast statements

Historical
  • 01 Sep 2015: there was a 4.17% swing from 1 to 0
  • 01 Dec 2015: there was a 16.67% swing from 0 to 1
  • 01 Mar 2016: there was a 14.29% swing from 1 to 0
  • 01 Mar 2017: there was a 10.71% swing from 1 to 0
  • 01 Mar 2018: there was a 75% swing from 1 to 0

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

Based on 141 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 100%
yes yes 0%

Based on 684 control structures

Historical
  • 01 Sep 2015: there was a 4% swing from no to yes
  • 01 Mar 2016: there was a 13.06% swing from yes to no

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

Based on 2,780 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 128 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 141 files

Historical