Showing 77 of 77 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php/** * Copyright (C) 2016 Derek J. Lambert * * Permission is hereby granted, free of charge, to any person obtaining a copy
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php/** * Copyright (C) 2016 Derek J. Lambert * * Permission is hereby granted, free of charge, to any person obtaining a copy
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected function validateRing($ring) { if (! is_array($ring)) { throw new UnexpectedValueException('Polygon value must be array of "array", "' . gettype($ring) . '" found'); }
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected function validateRing($ring) { if (! is_array($ring)) { throw new UnexpectedValueException('Polygon value must be array of "array", "' . gettype($ring) . '" found'); }
- Read upRead up
Method generate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generate($value, $typeHint = null) { if (! is_string($value) || '{' !== $value[0]) { throw new UnsupportedFormatException(); }
Method getJsonError
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getJsonError() { $error = json_last_error(); switch ($error) {
The class DataFactory has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13. Open
class DataFactory{ use Singleton; /**
- Read upRead up
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Function validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function validate(array &$data) { parent::validate($data); $count = count($data['value']);
- Read upRead up
Blank line found at start of control structure Open
} catch (\Exception $e) {
- Exclude checks
Function generate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function generate($value, $typeHint = null) { if (! is_string($value) || '{' !== $value[0]) { throw new UnsupportedFormatException(); }
- Read upRead up
Avoid too many return
statements within this method. Open
return 'Malformed UTF-8 characters, possibly incorrectly encoded';
Avoid too many return
statements within this method. Open
return 'Syntax error, malformed JSON';
Avoid too many return
statements within this method. Open
return 'Unknown error';
Avoid too many return
statements within this method. Open
return 'Unsupported type';
Avoid too many return
statements within this method. Open
return 'Value includes Inf or NaN';
Avoid too many return
statements within this method. Open
return 'Recursive references found';
Avoid too many return
statements within this method. Open
return null;
Function getTypeClass
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getTypeClass($type) { if (isset(self::$typeClassCache[$type])) { return self::$typeClassCache[$type]; }
- Read upRead up
Avoid using static access to class '\CrEOF\Geo\Obj\Data\DataFactory' in method '__construct'. Open
$this->valueFactory = DataFactory::getInstance();
- Read upRead up
- Exclude checks