Embed Instructions

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

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

Analysis of Coding Conventions for Google APIs Client Library

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 Google APIs Client Library

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 58.54%
yes yes 41.46%

Based on 4,288 assignment blocks

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
/* ... */ /* ... */ 36.6%
// ... - Most popular method // ... 63.4%

Based on 347 inline comments

Historical

Use of ELSE IF or ELSEIF

Are elseif statements defined using elseif or else if?

Current
Key Method Use
else if - Most popular method else if 70%
elseif elseif 30%

Based on 20 elseif statements

Historical
  • 01 May 2015: there was a 3.68% swing from else if to elseif

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 70.63%
yes yes 29.37%

Based on 126 files

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 75%
yes yes 25%

Based on 4 array definitions

Historical

Class has doc comment

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

Current
Key Method Use
no - Most popular method no 79.07%
yes yes 20.93%

Based on 2,995 classes

Historical

Function has doc comment

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

Current
Key Method Use
no - Most popular method no 91.1%
yes yes 8.9%

Based on 23,607 functions

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.24%
1 - Most popular method 1 91.79%
newline newline 5.97%

Based on 134 concat operators

Historical

One class per file

Is each class defined in a file by itself?

Current
Key Method Use
no - Most popular method no 95.83%
yes yes 4.17%

Based on 2,995 classes

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 0.75%
1 - Most popular method 1 96.27%
newline newline 2.99%

Based on 134 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 96.3%
81-120 81-120 3.48%
121-150 121-150 0.19%
151 or more 151 or more 0.03%

Based on 198,049 lines

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
1 - Most popular method 1 97.62%
5 5 2.38%

Based on 126 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
1 - Most popular method 1 97.79%
newline newline 2.21%

Based on 271 operators

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 99.21%
yes yes 0.79%

Based on 126 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 0.79%
yes - Most popular method yes 99.21%

Based on 126 files

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.33%
1 1 0.45%
newline newline 0.22%

Based on 448 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.55%
1 1 0.45%

Based on 448 control structures

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.01%
1 - Most popular method 1 99.56%
2 2 < 0.01%
newline newline 0.43%

Based on 53,212 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 0.29%
yes - Most popular method yes 99.71%

Based on 23,490 methods

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.8%
1 1 0.2%

Based on 495 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?

This project is using the popular method for this convention

Current
Key Method Use
new line - Most popular method new line 99.96%
same line same line 0.04%

Based on 23,592 functions

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 25,948 object operators

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

Based on 25,948 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 100%

Based on 3,241 PHP constants

Historical

PascalCase class name

Are class names defined using PascalCase?

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

Based on 2,995 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 2,995 classes

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

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 17,203 array definitions

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%

Based on 45,980 statements

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 25 PHP types

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

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

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 37 private methods

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 17,203 array definitions

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

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

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%

Based on 491 control structures

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 253 constants

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 2,995 classes

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 7 cast statements

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%

Based on 181,528 indented lines

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

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 101,800 keywords

Historical