Showing 23 of 23 total issues
Function readVersion
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private function readVersion()
{
$this->version = null;
if ($this->path_ssversion) {
$content_ssv = file_get_contents($this->path_ssversion);
- 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 readEnvironmentType
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function readEnvironmentType()
{
$et = $this->matchInConfigPhp("/\\s*Director::set_environment_type\\(\\s*['\"](?<env>dev|live|test*)['\"]\\s*\\);/m");
if ($et && $et["env"]) {
$this->envtype = $et["env"][0];
- 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 execute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$cfg = $this->getSelimConfig($input);
$skippaths = $input->getOption("skip-known-paths") ? true : false;
$path = realpath($input->getArgument("path"));
- 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 configure
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
->setName('start')
Function readEmailLogging
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function readEmailLogging()
{
$m = $this->matchInConfigPhp("/\\s*SS_Log::add_writer\\(\\s*new\\s*SS_LogEmailWriter/m");
$this->maillog = $m && $m[0] && $m[0][0] ? true : false;
if ($this->path_configyml) {
- 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 execute
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$cfg = $this->getSelimConfig($input);
$sites = $cfg->getSites();
- 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 execute
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$cfg = $this->getSelimConfig($input);
$sites = $cfg->getSites();
Method execute
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$cfg = $this->getSelimConfig($input);
$skippaths = $input->getOption("skip-known-paths") ? true : false;
$path = realpath($input->getArgument("path"));
Function filterPagesByEnvironmentType
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function filterPagesByEnvironmentType($sspages, $env) {
$arr = array();
if(preg_match("/^(dev|test|live)$/",$env) === 1){
foreach ($sspages as $sspage) {
if (!$sspage instanceof SilverstripePage) {
- 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 readModules
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function readModules()
{
$modules = array();
$proj = basename($this->path_project);
- 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 readVersion
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readVersion()
{
$this->version = null;
if ($this->path_ssversion) {
$content_ssv = file_get_contents($this->path_ssversion);
Function setPath
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function setPath($config_path = "",$is_cli = true) {
$dir = dirname($config_path);
if(file_exists($dir)) {
if(!file_exists($config_path) && $is_cli){
echo "The file $config_path doesn't exist. Do you want to create it? yes/[no]";
- 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 execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$name = $input->getArgument('name');
$cfg = $this->getSelimConfig($input);
- 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 __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function __construct()
{
$request = Request::createFromGlobals();
$server = $request->server;
$selim_foldername = "/.selim/";
- 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
Avoid too many return
statements within this method. Open
return $sspage ? $sspage->getConfigYmlPath() : "_config/config.yml";
Avoid too many return
statements within this method. Open
return "";
Avoid too many return
statements within this method. Open
return $sspage ? $sspage->getEnvironmentType() : "EnvironmentType";
Avoid too many return
statements within this method. Open
return $sspage ? $sspage->getConfigPhpPath() : "_config.php";
Avoid too many return
statements within this method. Open
return $sspage ? self::ModuleText($sspage) : "Modules";
Function filterPagesByModules
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function filterPagesByModules(array $sspages, $filterRegex)
{
$arr = array();
foreach ($sspages as $sspage) {
if (!$sspage instanceof SilverstripePage) {
- 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"