File import.php
has 563 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
use Xmf\Module\Admin;
use Xmf\Request;
use XoopsModules\Songlist\Helper;
Avoid deeply nested control flow statements. Open
if ('' != trim($data[$_POST['title']])) {
$criteria->add(new \Criteria('title', trim($data[$_POST['title']])));
}
Avoid deeply nested control flow statements. Open
if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) {
$tagHandler = \XoopsModules\Tag\Helper::getInstance()->getHandler('Tag');
$tagHandler->updateByItem(trim($data[$_POST['tags']]), $sid, $GLOBALS['songlistModule']->getVar('dirname'), $cid);
}
Avoid deeply nested control flow statements. Open
if ($record > Request::getInt('records', 0, 'POST')) {
$start = time();
while (time() - $start < Request::getInt('wait', 0, 'POST')) {
}
$records = 0;
Avoid deeply nested control flow statements. Open
if ('' != trim($data[$_POST['songid']])) {
$criteria->add(new \Criteria('songid', trim($data[$_POST['songid']])));
}
Avoid deeply nested control flow statements. Open
if ($record > Request::getInt('records', 0, 'POST')) {
$start = time();
while (time() - $start < Request::getInt('wait', 0, 'POST')) {
}
$records = 0;
Avoid deeply nested control flow statements. Open
if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) {
$tagHandler = \XoopsModules\Tag\Helper::getInstance()->getHandler('Tag');
$tagHandler->updateByItem(trim($data[$_POST['tags']]), $sid, $GLOBALS['songlistModule']->getVar('dirname'), $cid);
}
Avoid deeply nested control flow statements. Open
if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')]) > 1) {
if (isset($data[$_POST[$field->getVar('field_name')]]) && '' != trim($_POST[$field->getVar('field_name')])) {
$extra->setVar($field->getVar('field_name'), trim($data[$_POST[$field->getVar('field_name')]]));
}
}
Avoid deeply nested control flow statements. Open
if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')]) > 1) {
if (isset($data[$_POST[$field->getVar('field_name')]]) && '' != trim($_POST[$field->getVar('field_name')])) {
$extra->setVar($field->getVar('field_name'), trim($data[$_POST[$field->getVar('field_name')]]));
}
}
Avoid deeply nested control flow statements. Open
if ($record > Request::getInt('records', 0, 'POST')) {
$start = time();
while (time() - $start < Request::getInt('wait', 0, 'POST')) {
}
$records = 0;
Avoid deeply nested control flow statements. Open
if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')]) > 1) {
if (isset($data[$_POST[$field->getVar('field_name')]]) && '' != trim($_POST[$field->getVar('field_name')])) {
$extra->setVar($field->getVar('field_name'), trim($data[$_POST[$field->getVar('field_name')]]));
}
}
Avoid deeply nested control flow statements. Open
if ('' != trim($data[$_POST['title']])) {
$criteria->add(new \Criteria('title', trim($data[$_POST['title']])));
}
Avoid deeply nested control flow statements. Open
if ('' != trim($data[$_POST['songid']])) {
$criteria->add(new \Criteria('songid', trim($data[$_POST['songid']])));
}
Avoid deeply nested control flow statements. Open
if ('' != trim($data[$_POST['songid']])) {
$criteria->add(new \Criteria('songid', trim($data[$_POST['songid']])));
}
Avoid deeply nested control flow statements. Open
if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) {
$tagHandler = \XoopsModules\Tag\Helper::getInstance()->getHandler('Tag');
$tagHandler->updateByItem(trim($data[$_POST['tags']]), $sid, $GLOBALS['songlistModule']->getVar('dirname'), $cid);
}
Avoid deeply nested control flow statements. Open
if ('' != trim($data[$_POST['title']])) {
$criteria->add(new \Criteria('title', trim($data[$_POST['title']])));
}
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ((!empty($_POST['songid']) && mb_strlen($_POST['songid']) > 1) || (!empty($_POST['title']) && mb_strlen($_POST['title']) > 1)) {
if ((isset($data[$_POST['songid']]) && '' != $_POST['songid']) || (isset($data[$_POST['title']]) && '' != $_POST['title'])) {
$criteria = new \CriteriaCompo();
if ('' != trim($data[$_POST['songid']])) {
$criteria->add(new \Criteria('songid', trim($data[$_POST['songid']])));
- Read upRead up
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 1002.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ((!empty($_POST['songid']) && mb_strlen($_POST['songid']) > 1) || (!empty($_POST['title']) && mb_strlen($_POST['title']) > 1)) {
if ((isset($data[$_POST['songid']]) && '' != $_POST['songid']) || (isset($data[$_POST['title']]) && '' != $_POST['title'])) {
$criteria = new \CriteriaCompo();
if ('' != trim($data[$_POST['songid']])) {
$criteria->add(new \Criteria('songid', trim($data[$_POST['songid']])));
- Read upRead up
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 1002.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!empty($_POST['artist']) && mb_strlen($_POST['artist']) > 1) {
if (isset($data[$_POST['artist']]) && '' != $_POST['artist']) {
foreach (explode(',', trim($data[$_POST['artist']])) as $artist) {
$criteria = new \Criteria('name', trim($artist));
if ($artistsHandler->getCount($criteria) > 0) {
- Read upRead up
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 255.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!empty($_POST['artist']) && mb_strlen($_POST['artist']) > 1) {
if (isset($data[$_POST['artist']]) && '' != $_POST['artist']) {
foreach (explode(',', trim($data[$_POST['artist']])) as $artist) {
$criteria = new \Criteria('name', trim($artist));
if ($artistsHandler->getCount($criteria) > 0) {
- Read upRead up
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 255.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if (!empty($_POST['genre']) && mb_strlen($_POST['genre']) > 1) {
if (isset($data[$_POST['genre']]) && '' != trim($_POST['genre'])) {
foreach (explode(',', trim($data[$_POST['genre']])) as $genre) {
$criteria = new \Criteria('name', trim($genre));
if ($genreHandler->getCount($criteria) > 0) {
- Read upRead up
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 228.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if (!empty($_POST['genre']) && mb_strlen($_POST['genre']) > 1) {
if (isset($data[$_POST['genre']]) && '' != trim($_POST['genre'])) {
foreach (explode(',', trim($data[$_POST['genre']])) as $genre) {
$criteria = new \Criteria('name', trim($genre));
if ($genreHandler->getCount($criteria) > 0) {
- Read upRead up
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 228.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if (!empty($_POST['genre']) && mb_strlen($_POST['genre']) > 1) {
if (isset($data[$_POST['genre']]) && '' != trim($_POST['genre'])) {
foreach (explode(',', trim($data[$_POST['genre']])) as $genre) {
$criteria = new \Criteria('name', trim($genre));
if ($genreHandler->getCount($criteria) > 0) {
- Read upRead up
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 228.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if (!empty($_POST['album']) && mb_strlen($_POST['album']) > 1) {
if (isset($data[$_POST['album']]) && '' != trim($_POST['album'])) {
$criteria = new \Criteria('title', trim($data[$_POST['album']]));
if ($albumsHandler->getCount($criteria) > 0) {
$objects = $albumsHandler->getObjects($criteria, false);
- Read upRead up
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 226.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if (!empty($_POST['album']) && mb_strlen($_POST['album']) > 1) {
if (isset($data[$_POST['album']]) && '' != trim($_POST['album'])) {
$criteria = new \Criteria('title', trim($data[$_POST['album']]));
if ($albumsHandler->getCount($criteria) > 0) {
$objects = $albumsHandler->getObjects($criteria, false);
- Read upRead up
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 226.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if (!empty($_POST['album']) && mb_strlen($_POST['album']) > 1) {
if (isset($data[$_POST['album']]) && '' != trim($_POST['album'])) {
$criteria = new \Criteria('title', trim($data[$_POST['album']]));
if ($albumsHandler->getCount($criteria) > 0) {
$objects = $albumsHandler->getObjects($criteria, false);
- Read upRead up
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 226.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
if (!empty($_POST['voice']) && mb_strlen($_POST['voice']) > 1) {
if (isset($data[$_POST['voice']]) && '' != trim($_POST['voice'])) {
$criteria = new \Criteria('name', trim($data[$_POST['voice']]));
if ($voiceHandler->getCount($criteria) > 0) {
$objects = $voiceHandler->getObjects($criteria, false);
- Read upRead up
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 202.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
if (!empty($_POST['category']) && mb_strlen($_POST['category']) > 1) {
if (isset($data[$_POST['category']]) && '' != trim($_POST['category'])) {
$criteria = new \Criteria('name', trim($data[$_POST['category']]));
if ($categoryHandler->getCount($criteria) > 0) {
$objects = $categoryHandler->getObjects($criteria, false);
- Read upRead up
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 202.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
if (!empty($_POST['voice']) && mb_strlen($_POST['voice']) > 1) {
if (isset($data[$_POST['voice']]) && '' != trim($_POST['voice'])) {
$criteria = new \Criteria('name', trim($data[$_POST['voice']]));
if ($voiceHandler->getCount($criteria) > 0) {
$objects = $voiceHandler->getObjects($criteria, false);
- Read upRead up
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 202.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
if (!empty($_POST['voice']) && mb_strlen($_POST['voice']) > 1) {
if (isset($data[$_POST['voice']]) && '' != trim($_POST['voice'])) {
$criteria = new \Criteria('name', trim($data[$_POST['voice']]));
if ($voiceHandler->getCount($criteria) > 0) {
$objects = $voiceHandler->getObjects($criteria, false);
- Read upRead up
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 202.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
if (!empty($_POST['category']) && mb_strlen($_POST['category']) > 1) {
if (isset($data[$_POST['category']]) && '' != trim($_POST['category'])) {
$criteria = new \Criteria('name', trim($data[$_POST['category']]));
if ($categoryHandler->getCount($criteria) > 0) {
$objects = $categoryHandler->getObjects($criteria, false);
- Read upRead up
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 202.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
if (!empty($_POST['category']) && mb_strlen($_POST['category']) > 1) {
if (isset($data[$_POST['category']]) && '' != trim($_POST['category'])) {
$criteria = new \Criteria('name', trim($data[$_POST['category']]));
if ($categoryHandler->getCount($criteria) > 0) {
$objects = $categoryHandler->getObjects($criteria, false);
- Read upRead up
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 202.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
case 'actiona':
if (Request::hasVar('xmlfile', 'SESSION')) {
redirect_header($_SERVER['SCRIPT_NAME'] . '?file=' . $_SESSION['xmlfile'] . '&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED);
}
$adminObject = Admin::getInstance();
- Read upRead up
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 145.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if (Request::hasVar('limiting', 'POST')) {
if (true === Request::getInt('limiting', 0, 'POST')) {
++$record;
if ($record > Request::getInt('records', 0, 'POST')) {
$start = time();
- Read upRead up
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 114.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if (Request::hasVar('limiting', 'POST')) {
if (true === Request::getInt('limiting', 0, 'POST')) {
++$record;
if ($record > Request::getInt('records', 0, 'POST')) {
$start = time();
- Read upRead up
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 114.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if (Request::hasVar('limiting', 'POST')) {
if (true === Request::getInt('limiting', 0, 'POST')) {
++$record;
if ($record > Request::getInt('records', 0, 'POST')) {
$start = time();
- Read upRead up
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 114.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
case 'actionb':
$adminObject = Admin::getInstance();
$adminObject->displayNavigation(basename(__FILE__));
$GLOBALS['xoopsTpl']->assign('form', FormController::getFormImportb($_SESSION['xmlfile']));
- Read upRead up
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 92.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Line exceeds 120 characters; contains 159 characters Open
if ((!empty($_POST['songid']) && mb_strlen($_POST['songid']) > 1) || (!empty($_POST['title']) && mb_strlen($_POST['title']) > 1)) {
- Exclude checks
Line exceeds 120 characters; contains 144 characters Open
$extra->setVar($field->getVar('field_name'), trim($data[$_POST[$field->getVar('field_name')]]));
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
$extra->setVar($field->getVar('field_name'), trim($data[$_POST[$field->getVar('field_name')]]));
- Exclude checks
Line exceeds 120 characters; contains 176 characters Open
['application/xml', 'text/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity', 'text/xml xml xsl', 'text/xml-external-parsed-entity'],
- Exclude checks
Line exceeds 120 characters; contains 178 characters Open
$xmlarray = Utility::xml2array(file_get_contents($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'] . $_SESSION['xmlfile'])), false, 'tag');
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
$tagHandler->updateByItem(trim($data[$_POST['tags']]), $sid, $GLOBALS['songlistModule']->getVar('dirname'), $cid);
- Exclude checks
Line exceeds 120 characters; contains 153 characters Open
if (isset($data[$_POST[$field->getVar('field_name')]]) && '' != trim($_POST[$field->getVar('field_name')])) {
- Exclude checks
Line exceeds 120 characters; contains 200 characters Open
copy($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']) . $_POST['file'], $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas']) . $file);
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$objects = $artistsHandler->getObjects($criteria, false);
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
if ((isset($data[$_POST['songid']]) && '' != $_POST['songid']) || (isset($data[$_POST['title']]) && '' != $_POST['title'])) {
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$object->setVar('lyrics', str_replace("\n", "<br>\n", trim($data[$_POST['lyrics']])));
- Exclude checks
Line exceeds 120 characters; contains 159 characters Open
if ((!empty($_POST['songid']) && mb_strlen($_POST['songid']) > 1) || (!empty($_POST['title']) && mb_strlen($_POST['title']) > 1)) {
- Exclude checks
Line exceeds 120 characters; contains 146 characters Open
if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) {
- Exclude checks
Line exceeds 120 characters; contains 146 characters Open
if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) {
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
foreach ($artistsHandler->getObjects(new \Criteria('aid', '(' . implode(',', $aids) . ')', 'IN'), true) as $aid => $artist) {
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$objects = $artistsHandler->getObjects($criteria, false);
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$objects = $artistsHandler->getObjects($criteria, false);
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
unlink($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'] . $_SESSION['xmlfile']));
- Exclude checks
Line exceeds 120 characters; contains 170 characters Open
redirect_header($_SERVER['SCRIPT_NAME'] . '?file=' . $uploader->getSavedFileName() . '&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED);
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
$filesize = filesize($GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'] . $_SESSION['xmlfile']));
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
redirect_header($_SERVER['SCRIPT_NAME'] . '?file=' . $_SESSION['xmlfile'] . '&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_UPLOADED);
- Exclude checks
Line exceeds 120 characters; contains 153 characters Open
if (isset($data[$_POST[$field->getVar('field_name')]]) && '' != trim($_POST[$field->getVar('field_name')])) {
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
$tagHandler->updateByItem(trim($data[$_POST['tags']]), $sid, $GLOBALS['songlistModule']->getVar('dirname'), $cid);
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
$tagHandler->updateByItem(trim($data[$_POST['tags']]), $sid, $GLOBALS['songlistModule']->getVar('dirname'), $cid);
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
redirect_header($_SERVER['SCRIPT_NAME'] . '?file=' . $file . '&op=import&fct=actionb', 10, _AM_SONGLIST_XMLFILE_COPIED);
- Exclude checks
Line exceeds 120 characters; contains 142 characters Open
if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')]) > 1) {
- Exclude checks
Line exceeds 120 characters; contains 146 characters Open
if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')]) > 1) {
- Exclude checks
Line exceeds 120 characters; contains 153 characters Open
if ((isset($data[$_POST['songid']]) && '' != $_POST['songid']) || (isset($data[$_POST['title']]) && '' != $_POST['title'])) {
- Exclude checks
Line exceeds 120 characters; contains 142 characters Open
if ($GLOBALS['songlistModuleConfig']['tags'] && file_exists(XOOPS_ROOT_PATH . '/modules/tag/class/tag.php')) {
- Exclude checks
Line exceeds 120 characters; contains 149 characters Open
if (isset($data[$_POST[$field->getVar('field_name')]]) && '' != trim($_POST[$field->getVar('field_name')])) {
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
// foreach (explode('\\', $GLOBALS['xoops']->path($GLOBALS['songlistModuleConfig']['upload_areas'])) as $folders) {
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$object->setVar('lyrics', str_replace("\n", "<br>\n", trim($data[$_POST['lyrics']])));
- Exclude checks
Line exceeds 120 characters; contains 144 characters Open
$extra->setVar($field->getVar('field_name'), trim($data[$_POST[$field->getVar('field_name')]]));
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
foreach ($artistsHandler->getObjects(new \Criteria('aid', '(' . implode(',', $aids) . ')', 'IN'), true) as $aid => $artist) {
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
if ((isset($data[$_POST['songid']]) && '' != $_POST['songid']) || (isset($data[$_POST['title']]) && '' != $_POST['title'])) {
- Exclude checks
Line exceeds 120 characters; contains 146 characters Open
if (!empty($_POST[$field->getVar('field_name')]) && mb_strlen($_POST[$field->getVar('field_name')]) > 1) {
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
if ((!empty($_POST['songid']) && mb_strlen($_POST['songid']) > 1) || (!empty($_POST['title']) && mb_strlen($_POST['title']) > 1)) {
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
foreach ($artistsHandler->getObjects(new \Criteria('aid', '(' . implode(',', $aids) . ')', 'IN'), true) as $aid => $artist) {
- Exclude checks