Kylob/BootPress

View on GitHub

Showing 144 of 16,700 total issues

Function loadFilesBySignatures has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function loadFilesBySignatures()
    {
        $return = false;
        fseek($this->fh, 0);
        for (; ;) {
Severity: Minor
Found in src/Unzip/Component.php - About 25 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

Function bootstrap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function bootstrap(Form $form)
    {
        if (is_null(self::$folder)) {
            $dir = str_replace('\\', '/', __DIR__).'/uploads/';
            if (!is_dir($dir) && !mkdir($dir, 0755, true)) {
Severity: Minor
Found in src/Upload/Component.php - About 25 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

Function pages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function pages()
    {
        extract(Admin::params('bp', 'website', 'page', 'path', 'admin'));
        $page->title = 'Analytic Pages at '.$website;
        $url = $page->url($admin, $path, 'users'); // for linking most recent users
Severity: Minor
Found in src/Admin/Pages/Analytics.php - About 25 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

Function format has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function format($path, $slashes = false, $capitals = false)
    {
        if ($capitals === false) {
            $path = strtolower($path);
        }
Severity: Minor
Found in src/Admin/Files.php - About 25 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

Severity
Category
Status
Source
Language