Showing 1,426 of 1,426 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
4: {
buttonsClass: 'secondary',
iconsPrefix: 'fa',
icons: {
paginationSwitchDown: 'fa-toggle-down',
- 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 98.
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
Function execute
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): void
{
$firstId = $input->getOption('first-id');
if (null !== $firstId) {
$firstId = (int) $firstId;
- Read upRead up
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 send
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
send: function( headers, complete ) {
var i,
xhr = options.xhr();
xhr.open(
Function _fnSetObjectDataFn
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnSetObjectDataFn( mSource )
{
if ( $.isPlainObject( mSource ) )
{
/* Unlike get, only the underscore (global) option is used for for
Function initTable
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
BootstrapTable.prototype.initTable = function () {
var that = this,
columns = [],
data = [];
Function Alert
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function () {
function Alert(element) {
this._element = element;
} // Getters
Consider simplifying this complex logical expression. Open
if (column.checkbox || column.radio) {
type = column.checkbox ? 'checkbox' : type;
type = column.radio ? 'radio' : type;
text = [sprintf(that.options.cardView ?
Function show
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
_proto.show = function show() {
var _this = this;
if ($$$1(this.element).css('display') === 'none') {
throw new Error('Please use show on visible elements');
Method execute
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): void
{
$firstId = $input->getOption('first-id');
if (null !== $firstId) {
$firstId = (int) $firstId;
Function _fnGetRowElements
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnGetRowElements( settings, row, colIdx, d )
{
var
tds = [],
td = row.firstChild,
Function matcherFromGroupMatchers
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
Function add
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function( elem, types, handler, data, selector ) {
var handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
Function _fnAjaxParameters
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnAjaxParameters( settings )
{
var
columns = settings.aoColumns,
columnCount = columns.length,
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php declare(strict_types=1);
namespace VSV\GVQ_API\Quiz\Serializers;
use VSV\GVQ_API\Quiz\Events\AnsweredCorrect;
- 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 139.
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 2 locations. Consider refactoring. Open
<?php declare(strict_types=1);
namespace VSV\GVQ_API\Quiz\Serializers;
use VSV\GVQ_API\Quiz\Events\AnsweredIncorrect;
- 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 139.
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
File QuestionFormType.php
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace VSV\GVQ_API\Question\Forms;
use Ramsey\Uuid\UuidFactoryInterface;
Function _fnSort
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnSort ( oSettings )
{
var
i, ien, iLen, j, jLen, k, kLen,
sDataType, nTh,
Function attach
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
var attach = function( container, buttons ) {
var i, ien, node, button;
var clickHandler = function ( e ) {
e.preventDefault();
if ( !$(e.currentTarget).hasClass('disabled') && api.page() != e.data.action ) {
AccountViewController
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class AccountViewController extends AbstractController
{
/**
* @var RegistrationFormType
*/
Function resolve
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resolve( depth, deferred, handler, special ) {
return function() {
var that = this,
args = arguments,
mightThrow = function() {