Showing 37 of 92 total issues
File FilestackClientTest.php
has 779 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Filestack\Tests;
use Filestack\FilestackClient;
use Filestack\FilestackSecurity;
File FilestackTransformTest.php
has 753 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Filestack\Tests;
use Filestack\FilestackConfig;
use Filestack\Filelink;
Filelink
has 52 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Filelink
{
use Mixins\CommonMixin;
use Mixins\TransformationMixin;
File Filelink.php
has 403 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Filestack;
use GuzzleHttp\Client;
use Filestack\FilestackConfig;
File UploadProcessorTest.php
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Filestack\Tests;
use Filestack\FilestackConfig;
use Filestack\UploadProcessor;
FilestackTransformTest
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class FilestackTransformTest extends BaseTest
{
/**
* Test debugging a transformation url of a chained call
*/
FilestackClientTest
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class FilestackClientTest extends BaseTest
{
/**
* Test initializing FilestackClient with an API Key
*/
File FilelinkTest.php
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Filestack\Tests;
use Filestack\Filelink;
use Filestack\FilestackSecurity;
File UploadProcessor.php
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Filestack;
use Filestack\FilestackConfig;
use Filestack\HttpStatusCodes;
FilelinkTest
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class FilelinkTest extends BaseTest
{
/**
* Test initializing Filelink intialized with handle and API Key
*/
Function processChunks
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function processChunks($part, $chunks)
{
$upload_url = $this->getCustomUrl(FilestackConfig::UPLOAD_URL) . '/multipart/upload';
$max_retries = FilestackConfig::MAX_RETRIES;
- 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 createParts
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function createParts($api_key, $metadata, $upload_data)
{
$parts = [];
$max_part_size = FilestackConfig::UPLOAD_PART_SIZE;
$max_chunk_size = FilestackConfig::UPLOAD_CHUNK_SIZE;
Function createParts
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function createParts($api_key, $metadata, $upload_data)
{
$parts = [];
$max_part_size = FilestackConfig::UPLOAD_PART_SIZE;
$max_chunk_size = FilestackConfig::UPLOAD_CHUNK_SIZE;
- 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 processChunks
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function processChunks($part, $chunks)
{
$upload_url = $this->getCustomUrl(FilestackConfig::UPLOAD_URL) . '/multipart/upload';
$max_retries = FilestackConfig::MAX_RETRIES;
Method upload
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function upload($filepath, $options = [])
{
if (!file_exists($filepath)) {
throw new FilestackException("File not found", 400);
}
Method testProcessChunks
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testProcessChunks()
{
$mock_response1 = new MockHttpResponse(408, '{"error": "timed out"}');
$mock_response2 = new MockHttpResponse(504, '{"error": "Gateway timed out"}');
$mock_response3 = new MockHttpResponse(200,
Method testCollageSuccess
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testCollageSuccess()
{
$mock_response = new MockHttpResponse(
200,
'{"url": "http://cdn.filestackcontent.com/somehandle",'.
Method testUploadIntelligentSuccess
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testUploadIntelligentSuccess()
{
$mock_response_202 = new MockHttpResponse(202, '{accepted: true}');
$mock_response = new MockHttpResponse(200,
json_encode([
Method testUploadSuccessWithOptions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testUploadSuccessWithOptions()
{
$test_headers = ['ETag' =>['some-etag']];
$mock_response = new MockHttpResponse(200,
json_encode([
Method testconvertVideoSuccess
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testconvertVideoSuccess()
{
$mock_response = new MockHttpResponse(
200,
'{"uuid" : "some_uuid", "conversion_url": "http://someurl.com/handle"}'