Showing 37 of 92 total issues
Method testCollageSuccess
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testCollageSuccess()
{
$filelink = new Filelink($this->test_file_handle,
$this->test_api_key,
$this->test_security);
Method testUploadSuccessWithOptions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testUploadSuccessWithOptions()
{
$test_headers = ['ETag' =>['some-etag']];
$mock_response = new MockHttpResponse(200,
json_encode([
Method testCreatePartsIntelligentSuccess
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testCreatePartsIntelligentSuccess()
{
$mock_response = new MockHttpResponse(200,
json_encode([
'filename' => 'somefilename.jpg',
Method testProcessPartsIntelligentSuccess
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testProcessPartsIntelligentSuccess()
{
$test_headers = ['ETag' =>['some-etag']];
$mock_response = new MockHttpResponse(200,
json_encode([
Method testProcessPartsSuccess
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testProcessPartsSuccess()
{
$test_headers = ['ETag' =>['some-etag']];
$mock_response = new MockHttpResponse(200,
json_encode([
Method testCommitPartException
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testCommitPartException()
{
$this->expectException(FilestackException::class);
$this->expectExceptionCode(400);
Method registerComplete
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function registerComplete($api_key, $parts_etags, $upload_data,
$metadata)
{
$data = [];
$this->appendData($data, 'apikey', $api_key);
Method collage
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function collage($sources, $width, $height, $store_options = [],
$color = 'white', $fit = 'auto', $margin = 10, $auto_rotate = false)
Method collage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function collage($files, $width, $height,
$color = 'white', $fit = 'auto', $margin = 10, $auto_rotate = false)
Method screenshot
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function screenshot($url, $store_options = [],
$agent = 'desktop', $mode = 'all', $width = 1024, $height = 768, $delay = 0)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($handle, $api_key = '', $security = null,
$http_client = null, $cname = null)
Method createTransformUrl
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function createTransformUrl($api_key, $type, $resource,
$tasks_str, $security = null)
Method ascii
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function ascii($background = 'white', $colored = false,
$foreground='red', $reverse = false, $size = 100)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($api_key, $security = null, $http_client = null,
$upload_processor = null, $cname = null)
Function getSourceHeaders
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getSourceHeaders()
{
$headers = [];
if (!$this->user_agent_header || !$this->source_header) {
- 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 handleS3PromisesResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function handleS3PromisesResult($s3_results)
{
foreach ($s3_results as $promise) {
if ($promise['state'] !== 'fulfilled') {
$code = HttpStatusCodes::HTTP_SERVICE_UNAVAILABLE;
- 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 upload
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function upload($filepath, $options = [])
{
if (!file_exists($filepath)) {
throw new FilestackException("File not found", 400);
}
- 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"