iranianpep/code-jetter

View on GitHub
components/user/templates/membersList.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($childUsername), new Cell($childName), new Cell($childEmail), new Cell($childPhone), new Cell($childStatus), new Cell($cell6Content, false)]);
Severity: Minor
Found in components/user/templates/membersList.php and 1 other location - About 55 mins to fix
components/user/templates/adminMembersList.php on lines 89..89

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 181 characters
Open

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

Line exceeds 120 characters; contains 124 characters
Open

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

Line exceeds 120 characters; contains 131 characters
Open

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

Line exceeds 120 characters; contains 126 characters
Open

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

Line exceeds 120 characters; contains 128 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 128 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 212 characters
Open

        $tmpRow = new Row([new Cell($checkbox.' '.$counter), new Cell($childUsername), new Cell($childName), new Cell($childEmail), new Cell($childPhone), new Cell($childStatus), new Cell($cell6Content, false)]);

Line exceeds 120 characters; contains 128 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 214 characters
Open

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

Line exceeds 120 characters; contains 127 characters
Open

$newModalHtml = "<div class='modal fade' id='addMemberModal' tabindex='-1' role='dialog' aria-labelledby='addMemberModalLabel'>

Line exceeds 120 characters; contains 157 characters
Open

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

Line exceeds 120 characters; contains 207 characters
Open

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

Line exceeds 120 characters; contains 191 characters
Open

    <a href='#' data-toggle='modal' data-target='#deleteConfirmationModal' data-id='{$childId}' data-name='{$childName}' data-email='{$childEmail}'><span class='text-danger'>Delete</span></a>

There are no issues that match your filters.

Category
Status