Showing 31 of 37 total issues
File Release.php
has 756 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace thcolin\SceneReleaseParser;
use Mhor\MediaInfo\MediaInfo;
Function execute
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output){
$verbose = !$input -> getOption('non-verbose');
$interactive = !$input -> getOption('non-interactive');
$invasive = !$input -> getOption('non-invasive');
- 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 analyse
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
public static function analyse($path, $config = []){
if(!is_file($path)){
throw new InvalidArgumentException("File '".$path."' not found");
}
- 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 correct
has 182 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function correct(InputInterface $input, OutputInterface $output, Release $release){
$done = false;
do{
$output->writeln('');
Release
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
class Release{
const MOVIE = 'movie';
const TVSHOW = 'tvshow';
Method execute
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output){
$verbose = !$input -> getOption('non-verbose');
$interactive = !$input -> getOption('non-interactive');
$invasive = !$input -> getOption('non-invasive');
File RenamerCommand.php
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace thcolin\SceneReleaseParser\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
Method analyse
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function analyse($path, $config = []){
if(!is_file($path)){
throw new InvalidArgumentException("File '".$path."' not found");
}
Function parseLanguage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function parseLanguage(&$title){
$languages = [];
foreach(self::$languageStatic as $langue => $patterns){
if(!is_array($patterns)){
- 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 correct
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function correct(InputInterface $input, OutputInterface $output, Release $release){
$done = false;
do{
$output->writeln('');
- 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 __construct
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($name, $strict = true, $defaults = []){
foreach($defaults as $key => $default){
$const = $key.'Static';
if(property_exists(get_class(), $const) && !in_array($default, array_keys(self::$$const))){
Function guessResolution
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function guessResolution(){
if($this -> resolution){
return $this -> resolution;
} else if($this->getSource() == self::SOURCE_BLURAY || $this->getSource() == self::SOURCE_BDSCR){
return self::RESOLUTION_1080P;
- 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 parseAttribute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function parseAttribute(&$title, $attribute){
if(!in_array($attribute, [self::SOURCE, self::ENCODING, self::RESOLUTION, self::DUB])){
throw new InvalidArgumentException();
}
- 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 parseFlags
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function parseFlags(&$title){
$flags = [];
foreach(self::$flagsStatic as $key => $patterns){
if(!is_array($patterns)){
- 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 __toString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __toString(){
$arrays = [];
foreach([
$this -> getTitle(),
$this -> getYear(),
- 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 null;
Avoid too many return
statements within this method. Open
return $answer;
Avoid too many return
statements within this method. Open
return $answer;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return $answer;