marcelog/PAMI

View on GitHub

Showing 282 of 282 total issues

Function process has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $msgs = $this->getMessages();
        foreach ($msgs as $aMsg) {
            $this->logger->debug(
Severity: Minor
Found in src/PAMI/Client/Impl/ClientImpl.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

Function __construct has a Cognitive Complexity of 11 (exceeds 5 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

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

    public function open()
    {
        $cString = $this->scheme . $this->host . ':' . $this->port;
        $this->context = stream_context_create();
        $errno = 0;
Severity: Minor
Found in src/PAMI/Client/Impl/ClientImpl.php - About 1 hr to fix

    Method handle has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function handle(EventMessage $event)
        {
            if ($event instanceof \PAMI\Message\Event\AsyncAGIEvent) {
                if ($event->getSubEvent() == 'Start') {
                    switch($pid = pcntl_fork())
    Severity: Minor
    Found in doc/examples/asyncagi/example.php - About 1 hr to fix

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

      <?php
      /**
       * Event triggered when a dtmf is detected in a call.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/DTMFEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Event triggered when an agi executes an application.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/AGIExecEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Triggered when a hangup is detected.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/HangupEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Event triggered when linking (connecting) two channels.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/LinkEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Event triggered when exchanging rtp stats.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/RTPReceiverStatEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Event triggered when a bridge is created.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/BridgeCreateEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Event triggered for agents.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/AgentsEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Event triggered when exchanging rtp stats.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/RTCPReceiverStatEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Event triggered when exchanging rtp stats.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/RTPSenderStatEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Event triggered when a bridged channel is unlinked.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/UnlinkEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Event triggered when a bridge is destroyed.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/BridgeDestroyEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/ListDialplanEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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 12 locations. Consider refactoring.
      Open

      <?php
      /**
       * Event triggered when an action ShowDialPlan is issued.
       *
       * PHP Version 5
      Severity: Major
      Found in src/PAMI/Message/Event/ListDialplanEvent.php and 11 other locations - About 1 hr to fix
      src/PAMI/Message/Event/AGIExecEvent.php on lines 1..117
      src/PAMI/Message/Event/AgentsEvent.php on lines 1..117
      src/PAMI/Message/Event/BridgeCreateEvent.php on lines 1..115
      src/PAMI/Message/Event/BridgeDestroyEvent.php on lines 1..115
      src/PAMI/Message/Event/DTMFEvent.php on lines 1..117
      src/PAMI/Message/Event/HangupEvent.php on lines 1..117
      src/PAMI/Message/Event/LinkEvent.php on lines 1..117
      src/PAMI/Message/Event/RTCPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPReceiverStatEvent.php on lines 1..117
      src/PAMI/Message/Event/RTPSenderStatEvent.php on lines 1..117
      src/PAMI/Message/Event/UnlinkEvent.php on lines 1..117

      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 104.

      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

      The class AttendedTransferEvent has 77 public methods and attributes. Consider reducing the number of public items to less than 45.
      Open

      class AttendedTransferEvent extends EventMessage
      {
          const RESULT_FAIL = 'Fail';
          const RESULT_INVALID = 'Invalid';
          const RESULT_NOT_PERMITTED = 'Not Permitted';

      ExcessivePublicCount

      Since: 0.1

      A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

      Example

      public class Foo {
          public $value;
          public $something;
          public $var;
          // [... more more public attributes ...]
      
          public function doWork() {}
          public function doMoreWork() {}
          public function doWorkAgain() {}
          // [... more more public methods ...]
      }

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

      The class DongleDeviceEntryEvent has 59 public methods and attributes. Consider reducing the number of public items to less than 45.
      Open

      class DongleDeviceEntryEvent extends EventMessage
      {
          /**
           * Returns key: 'Device'.
           *

      ExcessivePublicCount

      Since: 0.1

      A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

      Example

      public class Foo {
          public $value;
          public $something;
          public $var;
          // [... more more public attributes ...]
      
          public function doWork() {}
          public function doMoreWork() {}
          public function doWorkAgain() {}
          // [... more more public methods ...]
      }

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

      The class UnParkedCallEvent has 51 public methods and attributes. Consider reducing the number of public items to less than 45.
      Open

      class UnParkedCallEvent extends EventMessage
      {
          /**
           * Returns key: 'Privilege'.
           *

      ExcessivePublicCount

      Since: 0.1

      A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

      Example

      public class Foo {
          public $value;
          public $something;
          public $var;
          // [... more more public attributes ...]
      
          public function doWork() {}
          public function doMoreWork() {}
          public function doWorkAgain() {}
          // [... more more public methods ...]
      }

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

      Method process has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function process()
          {
              $msgs = $this->getMessages();
              foreach ($msgs as $aMsg) {
                  $this->logger->debug(
      Severity: Minor
      Found in src/PAMI/Client/Impl/ClientImpl.php - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language