Showing 11 of 11 total issues
Function google_docs_base_url
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
private function google_docs_base_url( $matches, $attr, $rawattr ) {
$doc_type = $matches[2];
$base_url = $matches[0];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Filenames should be all lowercase with hyphens as word separators. Expected frontend.php, but found Frontend.php. Open
Open
<?php
- Exclude checks
Class file names should be based on the class name with "class-" prepended. Expected class-i18n.php, but found I18n.php. Open
Open
<?php
- Exclude checks
Expected 1 space before "?"; 2 found Open
Open
$width = isset( $rawattr['width'] ) ? absint( $rawattr['width'] ) : 0;
- Exclude checks
Expected 1 space before ":"; 2 found Open
Open
$width = isset( $rawattr['width'] ) ? absint( $rawattr['width'] ) : 0;
- Exclude checks
Class file names should be based on the class name with "class-" prepended. Expected class-frontend.php, but found Frontend.php. Open
Open
<?php
- Exclude checks
Filenames should be all lowercase with hyphens as word separators. Expected i18n.php, but found I18n.php. Open
Open
<?php
- Exclude checks
Class file names should be based on the class name with "class-" prepended. Expected class-plugin.php, but found Plugin.php. Open
Open
<?php
- Exclude checks
Filenames should be all lowercase with hyphens as word separators. Expected plugin.php, but found Plugin.php. Open
Open
<?php
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
Open
} else if ( $doc_type === 'spreadsheets' ) {
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
Open
} else if ( $doc_type === 'presentation' ) {
- Exclude checks