Showing 23 of 93 total issues
Function searchByTitleNative
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public function searchByTitleNative(string $title): array
{
try {
/**
* @var Title[] $answer
- 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 searchByTitleNative
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function searchByTitleNative(string $title): array
{
try {
/**
* @var Title[] $answer
Method getTvShow
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTvShow(int $id): TvShowTitle
{
try {
$tData = $this->oTmdbClient
->getTvApi()
File Tmdb.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* xMDB-API
*
* Copyright © 2017 pudelek.org.pl
Method getByImdbId
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getByImdbId(string $imdbId = null)
{
try {
$this->oLog->info(sprintf('Searching: %s', $imdbId));
if ($imdbId === null || $imdbId === '') {
Method getMovie
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMovie(int $id): Model\Tmdb\Movie\Title
{
try {
$tData = $this->oTmdbClient->getMoviesApi()->getMovie($id, [
'language' => $this->oClient->getLang(),
File Imdb.php
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* xMDB-API
*
* Copyright © 2017 pudelek.org.pl
Method getRating
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRating(string $imdbId): Rating
{
try {
$searchUrl = 'http://p.media-imdb.com/static-content/documents/v1/title/'
. $imdbId
Method searchByTitle
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function searchByTitle(string $title)
{
try {
/**
* @var Title[] $answer
Method create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function create(\stdClass $oData)
{
$oTitle = new static();
$oTitle->title = $oData->Title;
$oTitle->titleOrg = $oData->Title;
Method searchByTitleApi
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function searchByTitleApi(string $title): array
{
try {
$answer = [];
$tList = $this->getApiTitleSearch()->search($title, [
Method getByImdbId
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getByImdbId(string $imdbId, Ratio $oRatio = null)
{
try {
$oResp = $this->oClient->getAdapter()->useCache(
function () use ($imdbId) {
Function getTvShow
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getTvShow(int $id): TvShowTitle
{
try {
$tData = $this->oTmdbClient
->getTvApi()
- 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 getMovie
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getMovie(int $id): Model\Tmdb\Movie\Title
{
try {
$tData = $this->oTmdbClient->getMoviesApi()->getMovie($id, [
'language' => $this->oClient->getLang(),
- 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 getByTitle
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getByTitle(string $title)
{
try {
$oResp = $this->oClient->getAdapter()->useCache(
function () use ($title) {
Method searchByTitle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function searchByTitle(string $title, int $limit = null, Ratio $oRatio = null): array
{
/**
* @var Title[] $answer
* @var Title[] $tmpList
Method calculateRatio
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function calculateRatio(array $tTitles)
{
$this->items = [];
foreach ($tTitles as $item) {
$fTitleRatio = 0;
Function calculateRatio
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function calculateRatio(array $tTitles)
{
$this->items = [];
foreach ($tTitles as $item) {
$fTitleRatio = 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 searchByTitle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function searchByTitle(string $title, int $limit = null, Ratio $oRatio = null): array
{
/**
* @var Title[] $answer
* @var Title[] $tmpList
- 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 getByImdbId
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getByImdbId(string $imdbId = null)
{
try {
$this->oLog->info(sprintf('Searching: %s', $imdbId));
if ($imdbId === null || $imdbId === '') {
- 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"