marcelog/PAMI

View on GitHub

Showing 282 of 282 total issues

Method run has 140 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {
        $this->log('Run');
        $client = $this->getAgi();
        $loggerFacade = $client->getAsteriskLogger();
Severity: Major
Found in doc/examples/asyncagi/MyPAGIApplication.php - About 5 hrs to fix

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

    <?php
    /**
     * Event triggered when music on hold has stopped on a channel.
     *
     * PHP Version 5
    Severity: Major
    Found in src/PAMI/Message/Event/MusicOnHoldStopEvent.php and 4 other locations - About 4 hrs to fix
    src/PAMI/Message/Event/AsyncAGIEndEvent.php on lines 1..175
    src/PAMI/Message/Event/BridgeInfoChannelEvent.php on lines 1..175
    src/PAMI/Message/Event/RTCPReceivedEvent.php on lines 1..172
    src/PAMI/Message/Event/RTCPSentEvent.php on lines 1..177

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

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

    <?php
    /**
     * Event triggered when exchanging rtp stats.
     *
     * PHP Version 5
    Severity: Major
    Found in src/PAMI/Message/Event/RTCPReceivedEvent.php and 4 other locations - About 4 hrs to fix
    src/PAMI/Message/Event/AsyncAGIEndEvent.php on lines 1..175
    src/PAMI/Message/Event/BridgeInfoChannelEvent.php on lines 1..175
    src/PAMI/Message/Event/MusicOnHoldStopEvent.php on lines 1..175
    src/PAMI/Message/Event/RTCPSentEvent.php on lines 1..177

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

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

    <?php
    /**
     * Event triggered when a channel stops AsyncAGI command processing.
     *
     * PHP Version 5
    Severity: Major
    Found in src/PAMI/Message/Event/AsyncAGIEndEvent.php and 4 other locations - About 4 hrs to fix
    src/PAMI/Message/Event/BridgeInfoChannelEvent.php on lines 1..175
    src/PAMI/Message/Event/MusicOnHoldStopEvent.php on lines 1..175
    src/PAMI/Message/Event/RTCPReceivedEvent.php on lines 1..172
    src/PAMI/Message/Event/RTCPSentEvent.php on lines 1..177

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

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

    <?php
    /**
     * Event triggered when an action BridgeInfo is issued.
     *
     * PHP Version 5
    Severity: Major
    Found in src/PAMI/Message/Event/BridgeInfoChannelEvent.php and 4 other locations - About 4 hrs to fix
    src/PAMI/Message/Event/AsyncAGIEndEvent.php on lines 1..175
    src/PAMI/Message/Event/MusicOnHoldStopEvent.php on lines 1..175
    src/PAMI/Message/Event/RTCPReceivedEvent.php on lines 1..172
    src/PAMI/Message/Event/RTCPSentEvent.php on lines 1..177

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

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

    <?php
    /**
     * Event triggered when exchanging rtp stats.
     *
     * PHP Version 5
    Severity: Major
    Found in src/PAMI/Message/Event/RTCPSentEvent.php and 4 other locations - About 4 hrs to fix
    src/PAMI/Message/Event/AsyncAGIEndEvent.php on lines 1..175
    src/PAMI/Message/Event/BridgeInfoChannelEvent.php on lines 1..175
    src/PAMI/Message/Event/MusicOnHoldStopEvent.php on lines 1..175
    src/PAMI/Message/Event/RTCPReceivedEvent.php on lines 1..172

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

    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

    BlindTransferEvent has 36 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class BlindTransferEvent extends EventMessage
    {
        const RESULT_FAIL = 'Fail';
        const RESULT_INVALID = 'Invalid';
        const RESULT_NOT_PERMITTED = 'Not Permitted';
    Severity: Minor
    Found in src/PAMI/Message/Event/BlindTransferEvent.php - About 4 hrs to fix

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

          public function run()
          {
              $this->log('Run');
              $client = $this->getAgi();
              $loggerFacade = $client->getAsteriskLogger();
      Severity: Minor
      Found in doc/examples/asyncagi/MyPAGIApplication.php - About 3 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

      ParkedCallGiveUpEvent has 30 functions (exceeds 20 allowed). Consider refactoring.
      Open

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

        ParkedCallTimeOutEvent has 30 functions (exceeds 20 allowed). Consider refactoring.
        Open

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

          File AttendedTransferEvent.php has 317 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Event triggered when a call is transfered.
           *
           * PHP Version 5
          Severity: Minor
          Found in src/PAMI/Message/Event/AttendedTransferEvent.php - About 3 hrs to fix

            The class AttendedTransferEvent has an overall complexity of 77 which is very high. The configured complexity threshold is 50.
            Open

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

            The class UnParkedCallEvent has an overall complexity of 60 which is very high. The configured complexity threshold is 50.
            Open

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

            The class DongleDeviceEntryEvent has an overall complexity of 59 which is very high. The configured complexity threshold is 50.
            Open

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

            ParkedCallEvent has 27 functions (exceeds 20 allowed). Consider refactoring.
            Open

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

              DialBeginEvent has 27 functions (exceeds 20 allowed). Consider refactoring.
              Open

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

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

                <?php
                /**
                 * Event triggered when a dial is executed.
                 *
                 * PHP Version 5
                Severity: Major
                Found in src/PAMI/Message/Event/DialEvent.php and 3 other locations - About 3 hrs to fix
                src/PAMI/Message/Event/NewchannelEvent.php on lines 1..147
                src/PAMI/Message/Event/OriginateResponseEvent.php on lines 1..147
                src/PAMI/Message/Event/TransferEvent.php on lines 1..147

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

                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 call is transfered.
                 *
                 * PHP Version 5
                Severity: Major
                Found in src/PAMI/Message/Event/TransferEvent.php and 3 other locations - About 3 hrs to fix
                src/PAMI/Message/Event/DialEvent.php on lines 1..147
                src/PAMI/Message/Event/NewchannelEvent.php on lines 1..147
                src/PAMI/Message/Event/OriginateResponseEvent.php on lines 1..147

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

                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
                /**
                 * Response from an async originate.
                 *
                 * PHP Version 5
                Severity: Major
                Found in src/PAMI/Message/Event/OriginateResponseEvent.php and 3 other locations - About 3 hrs to fix
                src/PAMI/Message/Event/DialEvent.php on lines 1..147
                src/PAMI/Message/Event/NewchannelEvent.php on lines 1..147
                src/PAMI/Message/Event/TransferEvent.php on lines 1..147

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

                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 new channel is created.
                 *
                 * PHP Version 5
                Severity: Major
                Found in src/PAMI/Message/Event/NewchannelEvent.php and 3 other locations - About 3 hrs to fix
                src/PAMI/Message/Event/DialEvent.php on lines 1..147
                src/PAMI/Message/Event/OriginateResponseEvent.php on lines 1..147
                src/PAMI/Message/Event/TransferEvent.php on lines 1..147

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

                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

                Severity
                Category
                Status
                Source
                Language