Util
has 51 functions (exceeds 20 allowed). Consider refactoring. Open
class Util {
// consts for Logging
public const DEBUG=0;
public const INFO=1;
public const WARN=2;
File Util.php
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Bart Visscher <bartv@thisnet.nl>
* @author Björn Schießle <bjoern@schiessle.org>
Method sendMail
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
$toaddress,
$toname,
$subject,
$mailtext,
$fromaddress,
Method getStatusInfo
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getStatusInfo($includeVersion = false, $serverHide = false, $hostnameShort = false) {
$systemConfig = \OC::$server->getSystemConfig();
$installed = (bool) $systemConfig->getValue('installed', false);
$maintenance = (bool) $systemConfig->getValue('maintenance', false);
Method sendMail
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function sendMail(
$toaddress,
$toname,
$subject,
$mailtext,
Function sendMail
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function sendMail(
$toaddress,
$toname,
$subject,
$mailtext,
- Read upRead up
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 getStatusInfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getStatusInfo($includeVersion = false, $serverHide = false, $hostnameShort = false) {
$systemConfig = \OC::$server->getSystemConfig();
$installed = (bool) $systemConfig->getValue('installed', false);
$maintenance = (bool) $systemConfig->getValue('maintenance', false);
- Read upRead up
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 getFullDomain
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getFullDomain($url) {
$parts = \parse_url($url);
if ($parts === false) {
throw new \InvalidArgumentException('Invalid url "' . $url . '"');
}
- Read upRead up
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 mb_substr_replace
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function mb_substr_replace($string, $replacement, $start, $length = null, $encoding = 'UTF-8') {
Method mb_str_replace
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function mb_str_replace($search, $replace, $subject, $encoding = 'UTF-8', &$count = null) {