Embed Instructions

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

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

Analysis of Coding Conventions for CodeIgniter

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 CodeIgniter

Back to top

View project specific report

Project
Consistency

Lowercase filename

Are PHP filenames lowercase?

Current
Key Method Use
no no 36.2%
yes - Most popular method yes 63.8%

Based on 163 files

Historical

CamelCase method name

Are class method names defined using CamelCase?

Current
Key Method Use
no - Most popular method no 69.25%
yes yes 30.75%

Based on 1,343 methods

Historical
  • 01 Jan 2017: there was a 3.73% swing from yes to no

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 79.02%
1 1 20.77%
newline newline 0.21%

Based on 3,370 control structures

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 80.45%
yes yes 19.55%

Based on 578 assignment blocks

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
1 - Most popular method 1 88.61%
newline newline 10.21%
Other other 1.18%

Based on 3,828 operators

Historical

Spacing before string concat

How many spaces precede the string concatenation operator?

Current
Key Method Use
0 - Most popular method 0 88.7%
1 1 0.06%
newline newline 11.24%

Based on 3,486 concat operators

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

Current
Key Method Use
no no 7.98%
yes - Most popular method yes 92.02%

Based on 163 files

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

Based on 131 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 96.05%
upper upper 3.95%

Based on 13,864 keywords

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

Based on 131 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 96.6%
81-120 81-120 2.99%
121-150 121-150 0.33%
151 or more 151 or more 0.08%

Based on 54,424 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
/* ... */ /* ... */ 2.11%
// ... - Most popular method // ... 97.89%

Based on 3,501 inline comments

Historical
  • 01 Feb 2015: there was a 8.29% swing from /* ... */ to // ...

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.61%
1 - Most popular method 1 99.39%

Based on 163 files

Historical
  • 01 Feb 2015: there was a 100% swing from 0 to 1

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.51%
mixed mixed 0.49%

Based on 205 PHP types

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 0.33%
1 - Most popular method 1 99.59%
2 2 0.02%
newline newline 0.06%

Based on 10,359 operators

Historical

PHP constant case

What case are PHP constants (true, false, null) written in?

Current
Key Method Use
lower lower 0.2%
upper - Most popular method upper 99.8%

Based on 2,540 PHP constants

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.81%
yes yes 0.19%

Based on 3,642 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.89%
1 1 0.11%

Based on 3,655 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 99.96%
newline newline 0.04%

Based on 7,842 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 99.97%
yes yes 0.03%

Based on 9,210 statements

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.97%
1 1 0.03%

Based on 3,370 control structures

Historical

Spacing after string concat

How many spaces follow the string concatenation operator?

Current
Key Method Use
0 - Most popular method 0 99.97%
newline newline 0.03%

Based on 3,486 concat operators

Historical

Line indent

Are lines indented using spaces or tabs?

Current
Key Method Use
mixed mixed 0.02%
tabs - Most popular method tabs 99.98%

Based on 45,169 indented lines

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

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

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

Historical

Private method prefixed with underscore

Are private methods prefixed with an underscore?

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

Based on 1 private methods

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 163 files

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

Based on 3,655 control structures

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

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

Based on 131 classes

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

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

Based on 163 files

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 7,842 object operators

Historical

Spacing after cast statement

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

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

Based on 186 cast statements

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

Based on 305 elseif statements

Historical

PascalCase class name

Are class names defined using PascalCase?

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

Based on 131 classes

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 38 non-class 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 126 global functions

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

Based on 1,564 functions

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

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

Based on 9 constants

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 163 files

Historical