iranianpep/code-jetter

View on GitHub
components/user/templates/adminMembersList.php

Summary

Maintainability
A
55 mins
Test Coverage

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

            $tmpRow = new Row([new Cell($checkbox.' '.$counter), new Cell($memberUsername), new Cell($memberName), new Cell($memberEmail), new Cell($memberPhone), new Cell($memberStatus), new Cell($cell6Content, false)]);
Severity: Minor
Found in components/user/templates/adminMembersList.php and 1 other location - About 55 mins to fix
components/user/templates/membersList.php on lines 77..77

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 99.

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

Line exceeds 120 characters; contains 206 characters
Open

        <a href='#' data-toggle='modal' data-target='#deleteConfirmationModal' data-id='{$memberId}' data-name='{$memberName}' data-email='{$memberEmail}'><span class='text-danger'>Delete Forever</span></a>

Line exceeds 120 characters; contains 156 characters
Open

<a type='button' class='btn btn-primary' onclick=\"checkAll(this, 'input[name=\'selectedMembers[]\']');\"><i class='fa fa-check' aria-hidden='true'></i></a>

Line exceeds 120 characters; contains 132 characters
Open

        <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>

Line exceeds 120 characters; contains 210 characters
Open

    $safeDeleteModalHtml = $htmlUtility->generateConfirmationModal('safeDeleteConfirmationModal', 'safeDeleteConfirmationModalLabel', 'Safe Delete', $formHandler, 'safeDeleteForm', '/admin/safe-delete-member');

Line exceeds 120 characters; contains 132 characters
Open

        <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>

Line exceeds 120 characters; contains 130 characters
Open

      <form class='addForm' data-url='/admin/add-member' data-submitter='global' data-close-on-success='true' data-refresh='true'>

Line exceeds 120 characters; contains 123 characters
Open

                    <input type='text' class='form-control' name='username' id='updateFormUsername' placeholder='Username'>

Line exceeds 120 characters; contains 210 characters
Open

    $batchDeleteModalHtml = $htmlUtility->generateConfirmationModal('batchDeleteConfirmationModal', 'batchDeleteConfirmationModalLabel', 'Delete', $formHandler, 'batchDeleteForm', '/admin/batch-delete-member');

Line exceeds 120 characters; contains 225 characters
Open

        <a href='#' data-toggle='modal' data-target='#batchDeleteConfirmationModal' data-callback='getCheckboxesValues' data-callbackArgs=\"input[name='selectedMembers[]']\"><span class='text-danger'>Delete Forever</span></a>

Line exceeds 120 characters; contains 154 characters
Open

      <form class='updateForm' data-url='/admin/update-member' data-submitter='global' data-refresh='true' data-populate='true' data-appendwhitelist='id'>

Line exceeds 120 characters; contains 130 characters
Open

  <button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>

Line exceeds 120 characters; contains 228 characters
Open

        <a href='#' data-toggle='modal' data-target='#safeBatchDeleteConfirmationModal' data-callback='getCheckboxesValues' data-callbackArgs=\"input[name='selectedMembers[]']\"><span class='text-danger'>Delete Safely</span></a>

Line exceeds 120 characters; contains 221 characters
Open

            $tmpRow = new Row([new Cell($checkbox.' '.$counter), new Cell($memberUsername), new Cell($memberName), new Cell($memberEmail), new Cell($memberPhone), new Cell($memberStatus), new Cell($cell6Content, false)]);

Line exceeds 120 characters; contains 122 characters
Open

                    <button type='button' class='btn btn-primary' data-toggle='modal' data-target='#addModal'>New</button>

Line exceeds 120 characters; contains 209 characters
Open

        <a href='#' data-toggle='modal' data-target='#safeDeleteConfirmationModal' data-id='{$memberId}' data-name='{$memberName}' data-email='{$memberEmail}'><span class='text-danger'>Delete Safely</span></a>

Line exceeds 120 characters; contains 130 characters
Open

  <button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>

Line exceeds 120 characters; contains 184 characters
Open

    $deleteModalHtml = $htmlUtility->generateConfirmationModal('deleteConfirmationModal', 'deleteConfirmationModalLabel', 'Delete', $formHandler, 'deleteForm', '/admin/delete-member');

Line exceeds 120 characters; contains 232 characters
Open

    $safeBatchDeleteModalHtml = $htmlUtility->generateConfirmationModal('safeBatchDeleteConfirmationModal', 'safeBatchDeleteConfirmationModalLabel', 'Safe Delete', $formHandler, 'batchDeleteForm', '/admin/safe-batch-delete-member');

Line exceeds 120 characters; contains 122 characters
Open

                        <input type='password' class='form-control' name='passwordConfirmation' id='passwordConfirmation'>

Line exceeds 120 characters; contains 247 characters
Open

        <a href='#' data-toggle='modal' data-target='#editModal' data-username='{$memberUsername}' data-id='{$memberId}' data-name='{$memberName}' data-email='{$memberEmail}' data-phone='{$memberPhone}' data-status='{$memberStatus}'>Quick Edit</a>

Line indented incorrectly; expected 0 spaces, found 4
Open

    }

Line indented incorrectly; expected 0 spaces, found 4
Open

    if ($numberHeadCell instanceof HeadCell) {

Line indented incorrectly; expected 4 spaces, found 8
Open

        }

Line indented incorrectly; expected 4 spaces, found 8
Open

        foreach ($members as $member) {

Line indented incorrectly; expected 0 spaces, found 4
Open

    } else {

Line indented incorrectly; expected 0 spaces, found 4
Open

    }

Line indented incorrectly; expected 0 spaces, found 4
Open

    if (!empty($members)) {

There are no issues that match your filters.

Category
Status