Showing 18 of 23 total issues
Function getVersion
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function getVersion($version)
{
if (!is_string($version)) {
throw new \InvalidArgumentException('Unexpected value, string expected!');
}
- 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 retrieveVersions
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function retrieveVersions()
{
if ($this->versions === null) {
$repository = escapeshellarg($this->joomlaRepository);
$result = `git ls-remote $repository | grep -E 'refs/(tags|heads)' | grep -v '{}'`;
- 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
Application
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Application extends JApplicationCli
{
protected $_messageQueue = array();
protected $_options = array();
Method configure
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this
->setName('core:install-db')
->setDescription('Install default joomla database')
Function installLanguage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function installLanguage(InputInterface $input, OutputInterface $output)
{
$joomlaApp = Bootstrapper::getApplication($input->getOption('path'));
$joomlaApp->set('list_limit', 10000);
$lang = $input->getArgument('language');
- 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 install
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function install($target)
{
$client = str_replace('/', '', (string)$this->manifest['client']);
- 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 installLanguage
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function installLanguage(InputInterface $input, OutputInterface $output)
{
$joomlaApp = Bootstrapper::getApplication($input->getOption('path'));
$joomlaApp->set('list_limit', 10000);
$lang = $input->getArgument('language');
Method createAdminUser
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createAdminUser()
{
$release = array_keys($this->version)[0];
if (is_numeric(substr($release, 0, 1)) && substr($release, 0, 1) < 3) {
// joomla 2.x admin user insert query
Method install
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function install($target)
{
// filter name according to 'cmd' JFilterInput
$name = strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', (string) $this->manifest->name));
Method getVersion
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getVersion($version)
{
if (!is_string($version)) {
throw new \InvalidArgumentException('Unexpected value, string expected!');
}
Method install
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function install($target)
{
$client = str_replace('/', '', (string)$this->manifest['client']);
Function install
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function install($target)
{
// filter name according to 'cmd' JFilterInput
$name = strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', (string) $this->manifest->name));
- 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 install
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function install($target)
{
$group = str_replace('/', '', (string)$this->manifest['group']);
- 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 installPackageFiles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function installPackageFiles(\SimpleXMLElement $element, $target)
{
if ($element['folder']) {
$source = $this->path . '/' . trim((string)$element['folder'], '/');
} else {
- 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 retrieveVersionsFromCache
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function retrieveVersionsFromCache()
{
// check if file exists and is new enough
if ($this->cachePath && file_exists($this->cachePath)) {
- 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 installLanguageFiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function installLanguageFiles(\SimpleXMLElement $element, $target)
{
$folderPrefix = '';
if ($element['folder']) {
$folderPrefix = (string)$element['folder'];
- 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 install
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function install($target)
{
// filter name according to 'cmd' JFilterInput
$name = strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', (string) $this->manifest->name));
$name = str_replace(' ', '_', $name); // this is done in joomla, probably will never have spaces, becuase of regexp
- 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 installMediaFiles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function installMediaFiles(\SimpleXMLElement $element, $target)
{
if ($element['folder']) {
$mediaFolder = (string)$element['destination'];
if (strpos($mediaFolder, '/../') !== 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"