marcelog/PAMI

View on GitHub

Showing 282 of 282 total issues

DialEndEvent has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

class DialEndEvent extends EventMessage
{
    /**
     * Returns key: 'Privilege'.
     *
Severity: Minor
Found in src/PAMI/Message/Event/DialEndEvent.php - About 3 hrs to fix

    VoicemailUserEntryEvent has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class VoicemailUserEntryEvent extends EventMessage
    {
        /**
         * Returns key: 'NewMessageCount'.
         *
    Severity: Minor
    Found in src/PAMI/Message/Event/VoicemailUserEntryEvent.php - About 2 hrs to fix

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

      class ConfbridgeTalkingEvent extends EventMessage
      {
          /**
           * Returns key: 'Privilege'.
           *
      Severity: Minor
      Found in src/PAMI/Message/Event/ConfbridgeTalkingEvent.php - About 2 hrs to fix

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

        class CELEvent extends EventMessage
        {
            /**
             * Returns key: 'AMAFlags'.
             *
        Severity: Minor
        Found in src/PAMI/Message/Event/CELEvent.php - About 2 hrs to fix

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          <?php
          /**
           * Event triggered when a channel changes its status.
           *
           * NOTE: For correct callerid values: see: https://issues.asterisk.org/jira/browse/ASTERISK-16910
          Severity: Major
          Found in src/PAMI/Message/Event/NewstateEvent.php and 2 other locations - About 2 hrs to fix
          src/PAMI/Message/Event/AgentConnectEvent.php on lines 1..137
          src/PAMI/Message/Event/BridgeEvent.php on lines 1..137

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 130.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          <?php
          /**
           * Event triggered when an agent connects.
           *
           * PHP Version 5
          Severity: Major
          Found in src/PAMI/Message/Event/AgentConnectEvent.php and 2 other locations - About 2 hrs to fix
          src/PAMI/Message/Event/BridgeEvent.php on lines 1..137
          src/PAMI/Message/Event/NewstateEvent.php on lines 1..139

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 130.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          <?php
          /**
           * Event triggered when bridging (connecting) two channels.
           *
           * PHP Version 5
          Severity: Major
          Found in src/PAMI/Message/Event/BridgeEvent.php and 2 other locations - About 2 hrs to fix
          src/PAMI/Message/Event/AgentConnectEvent.php on lines 1..137
          src/PAMI/Message/Event/NewstateEvent.php on lines 1..139

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 130.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

          class ConfbridgeMuteEvent extends EventMessage
          {
              /**
               * Returns key: 'Privilege'.
               *
          Severity: Minor
          Found in src/PAMI/Message/Event/ConfbridgeMuteEvent.php - About 2 hrs to fix

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

            class ConfbridgeLeaveEvent extends EventMessage
            {
                /**
                 * Returns key: 'Privilege'.
                 *
            Severity: Minor
            Found in src/PAMI/Message/Event/ConfbridgeLeaveEvent.php - About 2 hrs to fix

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

              class ConfbridgeJoinEvent extends EventMessage
              {
                  /**
                   * Returns key: 'Privilege'.
                   *
              Severity: Minor
              Found in src/PAMI/Message/Event/ConfbridgeJoinEvent.php - About 2 hrs to fix

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

                class ConfbridgeUnmuteEvent extends EventMessage
                {
                    /**
                     * Returns key: 'Privilege'.
                     *
                Severity: Minor
                Found in src/PAMI/Message/Event/ConfbridgeUnmuteEvent.php - About 2 hrs to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  /**
                   * Queue pause action.
                   *
                   * PHP Version 5
                  Severity: Major
                  Found in src/PAMI/Message/Action/QueuePauseAction.php and 1 other location - About 2 hrs to fix
                  src/PAMI/Message/Action/QueueUnpauseAction.php on lines 1..63

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 121.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  /**
                   * Queue unpause action. This does not exist in the ami.
                   *
                   * PHP Version 5
                  Severity: Major
                  Found in src/PAMI/Message/Action/QueueUnpauseAction.php and 1 other location - About 2 hrs to fix
                  src/PAMI/Message/Action/QueuePauseAction.php on lines 1..63

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 121.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  <?php
                  /**
                   * Event triggered when a confbridge is created.
                   *
                   * PHP Version 5
                  Severity: Major
                  Found in src/PAMI/Message/Event/ConfbridgeStartEvent.php and 3 other locations - About 1 hr to fix
                  src/PAMI/Message/Event/BridgeInfoCompleteEvent.php on lines 1..125
                  src/PAMI/Message/Event/ConfbridgeEndEvent.php on lines 1..125
                  src/PAMI/Message/Event/JoinEvent.php on lines 1..127

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 117.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  <?php
                  /**
                   * Event triggered when a confbridge is destroyed.
                   *
                   * PHP Version 5
                  Severity: Major
                  Found in src/PAMI/Message/Event/ConfbridgeEndEvent.php and 3 other locations - About 1 hr to fix
                  src/PAMI/Message/Event/BridgeInfoCompleteEvent.php on lines 1..125
                  src/PAMI/Message/Event/ConfbridgeStartEvent.php on lines 1..125
                  src/PAMI/Message/Event/JoinEvent.php on lines 1..127

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 117.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  <?php
                  /**
                   * Event triggered for the end of the list when an action BridgeInfo is issued.
                   *
                   * PHP Version 5
                  Severity: Major
                  Found in src/PAMI/Message/Event/BridgeInfoCompleteEvent.php and 3 other locations - About 1 hr to fix
                  src/PAMI/Message/Event/ConfbridgeEndEvent.php on lines 1..125
                  src/PAMI/Message/Event/ConfbridgeStartEvent.php on lines 1..125
                  src/PAMI/Message/Event/JoinEvent.php on lines 1..127

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 117.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  <?php
                  /**
                   * Event triggered when .. ?
                   *
                   * PHP Version 5
                  Severity: Major
                  Found in src/PAMI/Message/Event/JoinEvent.php and 3 other locations - About 1 hr to fix
                  src/PAMI/Message/Event/BridgeInfoCompleteEvent.php on lines 1..125
                  src/PAMI/Message/Event/ConfbridgeEndEvent.php on lines 1..125
                  src/PAMI/Message/Event/ConfbridgeStartEvent.php on lines 1..125

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 117.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                      private $currentProcessingMessage;
                  Severity: Minor
                  Found in src/PAMI/Client/Impl/ClientImpl.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 ClientImpl has 16 fields. Consider redesigning ClientImpl to keep the number of fields under 15.
                  Open

                  class ClientImpl implements IClient
                  {
                      /**
                       * PSR-3 logger.
                       * @var LoggerInterface
                  Severity: Minor
                  Found in src/PAMI/Client/Impl/ClientImpl.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 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function __construct($rawContent)
                      {
                          parent::__construct();
                          $this->channelVariables = array('default' => array());
                          $this->rawContent = $rawContent;
                  Severity: Minor
                  Found in src/PAMI/Message/IncomingMessage.php - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language