haringsrob/icecat

View on GitHub

Showing 8 of 8 total issues

Result has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

class Result implements ResultInterface
{

    /**
     * The actual data we fetched. To get the data you can use.
Severity: Minor
Found in src/Model/Result.php - About 2 hrs to fix

    Function getMultimediaObjects has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getMultimediaObjects($objectType = '')
        {
            if (empty($this->multimediaObjects)) {
                if ($this->productHasMultimediaObject()) {
                    $productMultimediaObjects = $this->getProductData()->ProductMultimediaObject->MultimediaObject;
    Severity: Minor
    Found in src/Model/Result.php - About 2 hrs to fix

    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 getImages has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getImages()
        {
            if (empty($this->images)) {
                if ($this->productHasImageGallery()) {
                    $productPictures = $this->getProductData()->ProductGallery->ProductPicture;
    Severity: Minor
    Found in src/Model/Result.php - About 1 hr to fix

    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 getMultimediaObjects has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getMultimediaObjects($objectType = '')
        {
            if (empty($this->multimediaObjects)) {
                if ($this->productHasMultimediaObject()) {
                    $productMultimediaObjects = $this->getProductData()->ProductMultimediaObject->MultimediaObject;
    Severity: Minor
    Found in src/Model/Result.php - About 1 hr to fix

      Function getReasonsToBuy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getReasonsToBuy()
          {
              if (empty($this->reasonsToBuy)) {
                  if ($this->productHasReasonsToBuy()) {
                      $productReasonsToBuy = $this->getProductData()->ReasonsToBuy->ReasonToBuy;
      Severity: Minor
      Found in src/Model/Result.php - About 55 mins to fix

      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 getSpecByIdentifier has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getSpecByIdentifier($identifier)
          {
              if ($this->productHasProductFeature()) {
                  $productFeature = $this->getProductData()->ProductFeature;
      
      
      Severity: Minor
      Found in src/Model/Result.php - About 45 mins to fix

      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 getSpecByName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getSpecByName($specificationName)
          {
              if ($this->productHasProductFeature()) {
                  $productFeature = $this->getProductData()->ProductFeature;
      
      
      Severity: Minor
      Found in src/Model/Result.php - About 45 mins to fix

      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 fetchBaseData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function fetchBaseData(MockHandler $handler = null)
          {
              foreach ($this->getUrls() as $url) {
                  $icecatRequest = new Client(['handler' => $handler]);
                  $icecatRequestResult = $icecatRequest->request(
      Severity: Minor
      Found in src/Model/FetcherBase.php - About 25 mins to fix

      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

      Severity
      Category
      Status
      Source
      Language