Kylob/BootPress

View on GitHub

Showing 16,700 of 16,700 total issues

The class Min_Result is not named in CamelCase.
Open

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Min_Driver is not named in CamelCase.
Open

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Min_DB is not named in CamelCase.
Open

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Min_DB is not named in CamelCase.
Open

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Min_Result is not named in CamelCase.
Open

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Min_Driver is not named in CamelCase.
Open

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Min_DB is not named in CamelCase.
Open

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Min_Result is not named in CamelCase.
Open

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Min_Result is not named in CamelCase.
Open

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class Min_Driver is not named in CamelCase.
Open

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $("#toolbar .decrease").click(function(){
        editor.setFontSize(Math.max(editor.getFontSize() - 1, 10));
    });
Severity: Minor
Found in src/Admin/Pages/admin/wyciwyg.js and 1 other location - About 50 mins to fix
src/Admin/Pages/admin/wyciwyg.js on lines 261..263

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $("#toolbar .increase").click(function(){
        editor.setFontSize(Math.min(editor.getFontSize() + 1, 20));
    });
Severity: Minor
Found in src/Admin/Pages/admin/wyciwyg.js and 1 other location - About 50 mins to fix
src/Admin/Pages/admin/wyciwyg.js on lines 265..267

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function sessions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private static function sessions($user_id)
    {
        extract(Admin::params('bp', 'page', 'auth'));
        $html = '';
        if (!$bp->pagination->set('sessions', 10)) {
Severity: Minor
Found in src/Admin/Pages/Users.php - About 45 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 signIn has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private static function signIn()
    {
        extract(Admin::params('bp', 'page', 'auth', 'path'));
        $page->title = 'Sign In for Admin Users';
        $html = '';
Severity: Minor
Found in src/Admin/Pages/Users.php - About 45 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 timeRange has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function timeRange($time, $range, $label = '')
    {
        // H - hour - 00 to 23
        // i - minute - 00 to 59
        // s - second - 00 to 59
Severity: Minor
Found in src/Admin/Pages/Analytics.php - About 45 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 display_wyciwyg has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function display_wyciwyg (classes, data, retrieve, file, line, col) {
Severity: Minor
Found in src/Admin/Pages/admin/wyciwyg.js - About 45 mins to fix

    Function extractFiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function extractFiles($files)
        {
            $file_locations = array();
            foreach ((array) $files as $extract) {
                foreach ($this->files() as $file) {
    Severity: Minor
    Found in src/Unzip/Component.php - About 45 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 getFileName has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function getFileName($source_name, $type, $tmp_name, $index, $content_range, FileUpload $upload)
    Severity: Minor
    Found in src/Upload/FileName.php - About 45 mins to fix

      Function extract has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function extract($allow_extensions = null, $remove_common_dir = false)
          {
              $locations = array();
              $files = $this->files();
              $start = $remove_common_dir ? mb_strlen(Page::html()->commonDir($files)) : 0;
      Severity: Minor
      Found in src/Unzip/Component.php - About 45 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 page has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function page()
          {
              extract(Admin::params('page', 'blog', 'bp'));
              if ($edit = $page->get('edit')) {
                  // enforce only one folder path ie. no subfolders
      Severity: Minor
      Found in src/Admin/Pages/Themes.php - About 45 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