mambax7/extgallery

View on GitHub
assets/js/magnific_popup/drupal/magnific_popup/includes/magnific_popup.image_styles.inc

Summary

Maintainability
Test Coverage

Avoid unused local variables such as '$module_path'.
Open

  $module_path = drupal_get_path('module', 'magnific_popup');

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Line exceeds 120 characters; contains 214 characters
Open

          'help' => 'Scale and crop will maintain the aspect-ratio of the original image, then crop the larger dimension. This is most useful for creating perfectly square thumbnails without stretching the image.',

Line indented incorrectly; expected at least 4 spaces, found 2
Open

  ];

Opening brace should be on a new line
Open

function magnific_popup_image_default_styles() {

Line indented incorrectly; expected at least 4 spaces, found 2
Open

  $styles = [];

Line indented incorrectly; expected at least 4 spaces, found 2
Open

  return $styles;

Line indented incorrectly; expected at least 4 spaces, found 2
Open

  $module_path = drupal_get_path('module', 'magnific_popup');

Line indented incorrectly; expected at least 4 spaces, found 2
Open

  $styles['magnific_popup_thumbnail'] = [

The variable $module_path is not named in camelCase.
Open

function magnific_popup_image_default_styles() {
  $styles = [];
  $module_path = drupal_get_path('module', 'magnific_popup');
  // Exported image style: thumbnail.
  $styles['magnific_popup_thumbnail'] = [

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status