gloireTR/Anidb

View on GitHub

Showing 20 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);
Severity: Minor
Found in src/creators/creators.php - About 1 day to fix

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);
Severity: Minor
Found in src/characters/characters.php - About 4 hrs to fix

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{
Severity: Minor
Found in src/creators/creators.php - About 4 hrs to fix

File Anime.php has 342 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
* Class AnidbAnime
* @brief Anime Setup
* @author gloire
Severity: Minor
Found in src/anime/Anime.php - About 4 hrs to fix

    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])){
    Severity: Minor
    Found in src/characters/characters.php - About 4 hrs to fix

    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);
    Severity: Minor
    Found in src/characters/characters.php - About 3 hrs to fix

    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];
    Severity: Minor
    Found in src/anime/Anime.php - About 2 hrs to fix

    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);
    Severity: Major
    Found in src/creators/creators.php - About 2 hrs to fix

      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];
      Severity: Major
      Found in src/anime/Anime.php - About 2 hrs to fix

        Anime has 23 functions (exceeds 20 allowed). Consider refactoring.
        Open

        final class Anime extends Options
        {
        /**
        * @param $cloud_name
        * @param $key
        Severity: Minor
        Found in src/anime/Anime.php - About 2 hrs to fix

          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);
          Severity: Major
          Found in src/characters/characters.php - About 2 hrs to fix

            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];
            Severity: Minor
            Found in src/anime/Anime.php - About 1 hr to fix

              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{
              Severity: Minor
              Found in src/creators/creators.php - About 1 hr to fix

                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])){
                Severity: Minor
                Found in src/characters/characters.php - About 1 hr to fix

                  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];
                  Severity: Minor
                  Found in src/anime/Anime.php - About 1 hr to fix

                    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);
                    Severity: Minor
                    Found in src/characters/characters.php - About 1 hr to fix

                      Method getDirectlyRelatedAnimes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      public function getDirectlyRelatedAnimes()
                      {
                      preg_match_all(parent::PATTERN_DIRECTLY_RELATED, $this->html, $directArr);
                      if (empty($directArr[0])) {
                      preg_match_all(parent::PATTERN_CONTROL_DIRECTLY_RELATED, $this->html, $directArr);
                      Severity: Minor
                      Found in src/anime/Anime.php - About 1 hr to fix

                        Function controlAndGetTitle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        public function controlAndGetTitle(){
                        preg_match_all(parent::PATTERN_CREATOR_TITLE, $this->html, $title);
                        if(isset($title[1][0]) || !empty($title[1][0])){
                        $title = $title[1][0];
                        }else{
                        Severity: Minor
                        Found in src/creators/creators.php - About 35 mins to fix

                        Function controlAndGetTitle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        public function controlAndGetTitle()
                        {
                        preg_match_all(parent::PATTERN_CHAR_TITLE, $this->html, $titleArr);
                        if (isset($titleArr[1][0]) || !empty($titleArr[1][0])) {
                        return $titleArr[1][0];
                        Severity: Minor
                        Found in src/characters/characters.php - About 35 mins to fix

                        Function getCast has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        public function getCast()
                        {
                        preg_match_all(parent::PATTERN_CAST, $this->html, $castArray);
                        if (!empty($castArray[0])) {
                        $firstCastId = $castArray[2][0];
                        Severity: Minor
                        Found in src/anime/Anime.php - About 25 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language