owncloud/core

View on GitHub
lib/private/Activity/Manager.php

Summary

Maintainability
C
1 day
Test Coverage

File Manager.php has 299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * @author Björn Schießle <bjoern@schiessle.org>
 * @author Joas Schilling <coding@schilljs.com>
 * @author Thomas Müller <thomas.mueller@tmit.eu>
Severity: Minor
Found in lib/private/Activity/Manager.php - About 3 hrs to fix

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

    class Manager implements IManager {
        /** @var IRequest */
        protected $request;
    
        /** @var IUserSession */
    Severity: Minor
    Found in lib/private/Activity/Manager.php - About 3 hrs to fix

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

          public function getNotificationTypes($languageCode) {
              $filesNotificationTypes = [];
              $sharingNotificationTypes = [];
      
              $notificationTypes = [];
      Severity: Minor
      Found in lib/private/Activity/Manager.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 publishActivity has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function publishActivity($app, $subject, $subjectParams, $message, $messageParams, $file, $link, $affectedUser, $type, $priority) {
      Severity: Major
      Found in lib/private/Activity/Manager.php - About 1 hr to fix

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

            public function publish(IEvent $event) {
                if (!$event->getApp()) {
                    throw new \BadMethodCallException('App not set', 10);
                }
                if (!$event->getType()) {
        Severity: Minor
        Found in lib/private/Activity/Manager.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 getQueryForFilter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getQueryForFilter($filter) {
                if (!$this->isFilterValid($filter)) {
                    return [null, null];
                }
        
        
        Severity: Minor
        Found in lib/private/Activity/Manager.php - About 55 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 translate has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
        Severity: Minor
        Found in lib/private/Activity/Manager.php - About 45 mins to fix

          There are no issues that match your filters.

          Category
          Status