mcred/FeedMeNow-PHP

View on GitHub

Showing 23 of 23 total issues

Restaurant has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class Restaurant
{
    private $id;
    private $name;
    private $imageUrl;
Severity: Minor
Found in src/FeedMeNow/Model/Restaurant.php - About 2 hrs to fix

    Method __construct has 18 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $id,
            $name,
            $imageUrl,
            $isClaimed,
            $isClosed,
    Severity: Major
    Found in src/FeedMeNow/Model/Restaurant.php - About 2 hrs to fix

      Avoid excessively long variable names like $multipartStreamBuilder. Keep variable name length under 20.
      Open

          private $multipartStreamBuilder;
      Severity: Minor
      Found in src/FeedMeNow/RequestBuilder.php by phpmd

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#longvariable

      The class Restaurant has 18 fields. Consider redesigning Restaurant to keep the number of fields under 15.
      Open

      class Restaurant
      {
          private $id;
          private $name;
          private $imageUrl;
      Severity: Minor
      Found in src/FeedMeNow/Model/Restaurant.php by phpmd

      TooManyFields

      Since: 0.1

      Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

      Example

      class Person {
         protected $one;
         private $two;
         private $three;
         [... many more fields ...]
      }

      Source https://phpmd.org/rules/codesize.html#toomanyfields

      Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $address1,
              $address2,
              $address3,
              $city,
              $zipCode,
      Severity: Major
      Found in src/FeedMeNow/Model/Address.php - About 1 hr to fix

        Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $name,
                $url,
                $fee,
                $serviceFee,
                $minimum,
        Severity: Major
        Found in src/FeedMeNow/Model/Provider.php - About 50 mins to fix

          Avoid variables with short names like $id. Configured minimum length is 3.
          Open

              private $id;
          Severity: Minor
          Found in src/FeedMeNow/Model/Restaurant.php by phpmd

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#shortvariable

          Avoid variables with short names like $id. Configured minimum length is 3.
          Open

                  $id,
          Severity: Minor
          Found in src/FeedMeNow/Model/Restaurant.php by phpmd

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#shortvariable

          Method name "Category::GetAlias" is not in camel caps format
          Open

              public function GetAlias()

          Method name "Category::GetTitle" is not in camel caps format
          Open

              public function GetTitle()

          Avoid using static access to class '\Webmozart\Assert\Assert' in method 'get'.
          Open

                  Assert::stringNotEmpty($address);
          Severity: Minor
          Found in src/FeedMeNow/Api/Provider.php by phpmd

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class '\FeedMeNow\Model\Restaurant' in method 'create'.
          Open

                      $return[] = Restaurant::create($item);
          Severity: Minor
          Found in src/FeedMeNow/Mapper/Provider.php by phpmd

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class '\FeedMeNow\Model\Hour' in method 'setHours'.
          Open

                      $return[] = Hour::create($hour);
          Severity: Minor
          Found in src/FeedMeNow/Model/Restaurant.php by phpmd

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class '\Http\Discovery\MessageFactoryDiscovery' in method 'getRequestFactory'.
          Open

                      $this->requestFactory = MessageFactoryDiscovery::find();
          Severity: Minor
          Found in src/FeedMeNow/RequestBuilder.php by phpmd

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class '\Webmozart\Assert\Assert' in method 'get'.
          Open

                  Assert::stringNotEmpty($address);
          Severity: Minor
          Found in src/FeedMeNow/Api/Search.php by phpmd

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid unused private fields such as '$multipartStreamBuilder'.
          Open

              private $multipartStreamBuilder;
          Severity: Minor
          Found in src/FeedMeNow/RequestBuilder.php by phpmd

          UnusedPrivateField

          Since: 0.2

          Detects when a private field is declared and/or assigned a value, but not used.

          Example

          class Something
          {
              private static $FOO = 2; // Unused
              private $i = 5; // Unused
              private $j = 6;
              public function addOne()
              {
                  return $this->j++;
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

          Avoid using static access to class '\Http\Discovery\HttpClientDiscovery' in method '__construct'.
          Open

                  $this->httpClient = $httpClient ?: HttpClientDiscovery::find();
          Severity: Minor
          Found in src/FeedMeNow/FeedMeNow.php by phpmd

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          The method __construct has 18 parameters. Consider reducing the number of parameters to less than 10.
          Open

              public function __construct(
                  $id,
                  $name,
                  $imageUrl,
                  $isClaimed,
          Severity: Minor
          Found in src/FeedMeNow/Model/Restaurant.php by phpmd

          Avoid using static access to class '\Webmozart\Assert\Assert' in method 'get'.
          Open

                  Assert::stringNotEmpty($term);
          Severity: Minor
          Found in src/FeedMeNow/Api/Search.php by phpmd

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class '\FeedMeNow\Model\Category' in method 'setCategories'.
          Open

                      $return[] = Category::create($category);
          Severity: Minor
          Found in src/FeedMeNow/Model/Restaurant.php by phpmd

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Severity
          Category
          Status
          Source
          Language