jeyroik/extas-alice

View on GitHub

Showing 10 of 10 total issues

ValueDatetime has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class ValueDatetime extends NLUValue implements IValueDatetime
{
    /**
     * @return int
     */
Severity: Minor
Found in src/components/yandex/calls/requests/nlu/values/ValueDatetime.php - About 2 hrs to fix

    Function playByMessageId has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function playByMessageId($messageId, $schema, $call, &$response)
        {
            /**
             * @var $reactions IScenarioReaction[]
             */
    Severity: Minor
    Found in src/components/yandex/skills/scenarios/Scenario.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 is has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function is($condition, $compareTo = null): bool
        {
            $cons = [
                static::CON__EQUAL => function ($cur, $compareTo) {
                    return $cur == $compareTo;
    Severity: Minor
    Found in src/components/yandex/calls/requests/nlu/values/ValueNumber.php - About 1 hr to fix

      Function run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function run()
          {
              $yandexCall = [];
              foreach ($this->getPluginsByStage('alice.call.get') as $plugin) {
                  $plugin($yandexCall);
      Severity: Minor
      Found in src/components/yandex/Alice.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 getItems has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getItems(ICard $card = null): array
          {
              $itemsData = isset($card[static::FIELD__ITEMS])
                  ? $card[static::FIELD__ITEMS]
                  : [];

      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

      Avoid too many return statements within this method.
      Open

                      return empty($cur);
      Severity: Major
      Found in src/components/yandex/calls/requests/nlu/values/ValueNumber.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return strpos($cur, $compareTo) !== false;
        Severity: Major
        Found in src/components/yandex/calls/requests/nlu/values/ValueNumber.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return isset($cons[$condition])
                      ? $cons[$condition]($this->getValue(), $compareTo)
                      : false;
          Severity: Major
          Found in src/components/yandex/calls/requests/nlu/values/ValueNumber.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return $cur <= $compareTo;
            Severity: Major
            Found in src/components/yandex/calls/requests/nlu/values/ValueNumber.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return $cur >= $compareTo;
              Severity: Major
              Found in src/components/yandex/calls/requests/nlu/values/ValueNumber.php - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language