Function parse
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
public function parse( $variant = null ) {
if ( !$variant ) {
$variant = $this->mConverter->getPreferredVariant();
}
- 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
Function generateConvTable
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
private function generateConvTable() {
// Special case optimisation
if ( !$this->mBidtable && !$this->mUnidtable ) {
$this->mConvTable = [];
return;
- 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
File ConverterRule.php
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
Function parseFlags
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function parseFlags() {
$text = $this->mText;
$flags = [];
$variantFlags = [];
- 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
Method parse
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse( $variant = null ) {
if ( !$variant ) {
$variant = $this->mConverter->getPreferredVariant();
}
Function parseRules
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function parseRules() {
$rules = $this->mRules;
$bidtable = [];
$unidtable = [];
$varsep_pattern = $this->mConverter->getVarSeparatorPattern();
- 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
Method parseFlags
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseFlags() {
$text = $this->mText;
$flags = [];
$variantFlags = [];
Method parseRules
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseRules() {
$rules = $this->mRules;
$bidtable = [];
$unidtable = [];
$varsep_pattern = $this->mConverter->getVarSeparatorPattern();
Method generateConvTable
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateConvTable() {
// Special case optimisation
if ( !$this->mBidtable && !$this->mUnidtable ) {
$this->mConvTable = [];
return;
Function getRuleConvertedStr
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getRuleConvertedStr( $variant ) {
$bidtable = $this->mBidtable;
$unidtable = $this->mUnidtable;
if ( count( $bidtable ) + count( $unidtable ) === 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"