fenos/Notifynder

View on GitHub

Showing 5 of 27 total issues

Builder has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class Builder implements ArrayAccess
{
    /**
     * @var Notification
     */
Severity: Minor
Found in src/Notifynder/Builder/Builder.php - About 2 hrs to fix

    Function mixedGet has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function mixedGet($object, $key, $default = null)
        {
            if (is_null($key) || trim($key) == '') {
                return '';
            }
    Severity: Minor
    Found in src/Notifynder/Parsers/NotificationParser.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 parse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function parse($notification)
        {
            $category = $notification->category;
            if (is_null($category)) {
                throw (new ModelNotFoundException)->setModel(
    Severity: Minor
    Found in src/Notifynder/Parsers/NotificationParser.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

    Method morphMany has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        abstract public function morphMany($related, $name, $type = null, $id = null, $localKey = null);
    Severity: Minor
    Found in src/Notifynder/Traits/Notifable.php - About 35 mins to fix

      Method morphMany has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          abstract public function morphMany($related, $name, $type = null, $id = null, $localKey = null);
      Severity: Minor
      Found in src/Notifynder/Traits/NotifableLaravel53.php - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language