creof/geo-obj

View on GitHub

Showing 12 of 77 total issues

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();
}
Severity: Minor
Found in lib/Data/Generator/GeoJson.php - About 1 hr to fix

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

    private function getJsonError()
    {
    $error = json_last_error();
     
    switch ($error) {
    Severity: Minor
    Found in lib/Data/Generator/GeoJson.php - About 1 hr to fix

      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();
      }
      Severity: Minor
      Found in lib/Data/Generator/GeoJson.php - About 35 mins to fix

      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']);
      Severity: Minor
      Found in lib/Validator/Data/PointValidator.php - About 35 mins to fix

      Avoid too many return statements within this method.
      Open

      return 'Unknown error';
      Severity: Major
      Found in lib/Data/Generator/GeoJson.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

        return 'Malformed UTF-8 characters, possibly incorrectly encoded';
        Severity: Major
        Found in lib/Data/Generator/GeoJson.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

          return 'Unsupported type';
          Severity: Major
          Found in lib/Data/Generator/GeoJson.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

            return 'Recursive references found';
            Severity: Major
            Found in lib/Data/Generator/GeoJson.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

              return 'Syntax error, malformed JSON';
              Severity: Major
              Found in lib/Data/Generator/GeoJson.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                return null;
                Severity: Major
                Found in lib/Data/Generator/SimpleArray.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                  return 'Value includes Inf or NaN';
                  Severity: Major
                  Found in lib/Data/Generator/GeoJson.php - About 30 mins to fix

                    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];
                    }
                    Severity: Minor
                    Found in lib/ObjectFactory.php - About 25 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language