Showing 14 of 35 total issues
Function run
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function run(t\TokenRegistry $tokens)
{
foreach ($tokens as $token) {
if (! $token instanceof t\WordToken) {
continue;
- 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 run
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function run(t\TokenRegistry $tokens)
{
foreach ($tokens as $token) {
if (! $token instanceof t\WordToken) {
continue;
- 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 run
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function run(t\TokenRegistry $tokens)
{
foreach ($tokens as $token) {
if (! $token instanceof t\WordToken) {
continue;
- 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 run
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(t\TokenRegistry $tokens)
{
foreach ($tokens as $token) {
if (! $token instanceof t\WordToken) {
continue;
Method run
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(t\TokenRegistry $tokens)
{
foreach ($tokens as $token) {
if (! $token instanceof t\WordToken) {
continue;
Method run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(t\TokenRegistry $tokens)
{
foreach ($tokens as $token) {
if (! $token instanceof t\WordToken) {
continue;
Function doConcatenate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function doConcatenate(t\TokenRegistry $tokens) // @codingStandardsIgnoreLine
{
$wordsWithNSyllables = [];
foreach ($tokens as $token) {
if (! $token instanceof t\WordToken) {
- 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 doConcatenate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function doConcatenate(t\TokenRegistry $tokens) // @codingStandardsIgnoreLine
{
$wordsWithNSyllables = [];
foreach ($tokens as $token) {
if (! $token instanceof t\WordToken) {
- 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
Avoid too many return
statements within this method. Open
return 'college graduate';
Avoid too many return
statements within this method. Open
return 12;
Avoid too many return
statements within this method. Open
return 'college';
Function calculate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function calculate(Text $text)
{
$fre = $this->fleschReadingEaseCalculator->calculate($text);
if ($fre > 90) {
- 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 calculate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function calculate(Text $text)
{
$tokens = $this->tokenizer->tokenize($text->getPlainText());
$maxSyllables = 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
Function doConcatenate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function doConcatenate(t\TokenRegistry $tokens) // @codingStandardsIgnoreLine
{
$syllables = [];
foreach ($tokens as $token) {
if (! $token instanceof t\WordToken) {
- 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"