Showing 24 of 24 total issues
Function getAnimes
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
public function getAnimes(){
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$control = '';
preg_match_all(parent::PATTERN_CREATOR_ANIMES . $this->creator_id . parent::PATTERN_SECOND_CREATOR_ANIMES, $this->html, $arr);
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!empty($directArr[0])) {
$del = explode('/', $directArr[3][0]);
$firstKey = end($del);
$firstValue = $directArr[4][0];
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 301.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!empty($similarArray[0])) {
$del = explode('/', $similarArray[3][0]);
$firstKey = end($del);
$firstValue = $similarArray[4][0];
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 301.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
foreach ($tr as $t) {
$childTr = $t->childNodes;
foreach ($childTr as $ts) {
if ($ts->nodeName == 'th') {
array_push($keys, strtolower($ts->nodeValue));
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 210.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
foreach ($tr as $t){
$test = $t->childNodes;
foreach ($test as $ts){
if ($ts->nodeName == 'th'){
array_push($keys, strtolower($ts->nodeValue));
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 210.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function getCreator
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function getCreator()
{
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$dom->loadHTML($this->html);
- 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 getInfo
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function getInfo(){
preg_match_all(parent::PATTERN_CREATOR_INFO, $this->html, $arr);
if (!isset($arr[0][0]) || empty($arr[0][0])){
return 'null';
}else{
- 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 Anime.php
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Class AnidbAnime
* @brief Anime Setup
* @author gloire
Function getRelatedAnimes
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function getRelatedAnimes(){
$dom = new DOMDocument();
libxml_use_internal_errors(true);
preg_match_all(parent::PATTERN_CHAR_RELATED, $this->html, $arr);
if (!isset($arr[2][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 getInfo
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getInfo()
{
preg_match_all(parent::PATTERN_CHAR_INFO, $this->html, $arr);
$dom = new DOMDocument();
libxml_use_internal_errors(true);
- 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 getStaff
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getStaff()
{
preg_match_all(parent::PATTERN_STAFF, $this->html, $exArray);
if (isset($exArray[1][0]) && isset($exArray[2][0])) {
$firstId = $exArray[1][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
Method getAnimes
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAnimes(){
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$control = '';
preg_match_all(parent::PATTERN_CREATOR_ANIMES . $this->creator_id . parent::PATTERN_SECOND_CREATOR_ANIMES, $this->html, $arr);
Method getStaff
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStaff()
{
preg_match_all(parent::PATTERN_STAFF, $this->html, $exArray);
if (isset($exArray[1][0]) && isset($exArray[2][0])) {
$firstId = $exArray[1][0];
Anime
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
final class Anime extends Options
{
/**
* @param $cloud_name
* @param $key
Method getCreator
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCreator()
{
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$dom->loadHTML($this->html);
Method getCharacters
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCharacters()
{
preg_match_all(parent::PATTERN_CHARACTERS, $this->html, $mainCharArray);
if (!empty($mainCharArray[0])) {
$firstCharId = $mainCharArray[7][0];
Method getInfo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInfo(){
preg_match_all(parent::PATTERN_CREATOR_INFO, $this->html, $arr);
if (!isset($arr[0][0]) || empty($arr[0][0])){
return 'null';
}else{
Method getRelatedAnimes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRelatedAnimes(){
$dom = new DOMDocument();
libxml_use_internal_errors(true);
preg_match_all(parent::PATTERN_CHAR_RELATED, $this->html, $arr);
if (!isset($arr[2][0])){
Method getCast
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCast()
{
preg_match_all(parent::PATTERN_CAST, $this->html, $castArray);
if (!empty($castArray[0])) {
$firstCastId = $castArray[2][0];
Method getInfo
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInfo()
{
preg_match_all(parent::PATTERN_CHAR_INFO, $this->html, $arr);
$dom = new DOMDocument();
libxml_use_internal_errors(true);