Showing 922 of 922 total issues
Function keyHandler
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
keyHandler: function (field, e) {
var picker = this.getPicker(),
currentSelection, index;
switch (e.getKey()) {
case e.DOWN:
- 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 keyHandler
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
keyHandler: function (field, e)
{
var picker = this.getPicker();
var grid = picker.getGrid();
- 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 buildUrl
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
buildUrl: function (request)
{
var operation = request.getOperation();
// Set the URI to the ID, as JSON-LD operates on IRIs.
- 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 getEditingContext
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
getEditingContext: function (record, columnHeader)
{
var me = this,
grid = me.grid,
colMgr = grid.visibleColumnManager,
- 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 setAssociationData
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
setAssociationData: function (data)
{
var setterName, getterName, roleName, store, idProperty;
for (roleName in data) {
- 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 flatten
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function flatten($data, $mappings)
{
$accessor = PropertyAccess::createPropertyAccessor();
$finalData = [];
foreach ($data as $key => $row) {
- 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 initComponent
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
initComponent: function ()
{
// Initialize the window with the title template
this.title = this.titleTemplate;
Function initComponent
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
initComponent: function ()
{
/**
* Due to an ExtJS issue, we need to delay the event
* for a bit.
Function onItemSave
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
onItemSave: function ()
{
var removeRecords = [], j, errors = [],
minDistributorCount = PartKeepr.getApplication().getSystemPreference(
"partkeepr.part.constraints.distributorCount", 0),
File Ext.ux.Wizard.js
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
Ext.define('Ext.ux.Wizard', {
extend: 'Ext.window.Window',
// layout: 'Ext.ux.wizard.CardLayout',
layout: 'fit',
loadMaskConfig: {
Similar blocks of code found in 2 locations. Consider refactoring. Open
onDeleteUpdateFieldButtonClick: function ()
{
var selection = this.down("#batchJobUpdateFields").getSelectionModel().getSelection()[0];
if (selection) {
this.down("#batchJobUpdateFields").getStore().remove(selection);
- 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 76.
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
onDeleteQueryFieldButtonClick: function ()
{
var selection = this.down("#batchJobQueryFields").getSelectionModel().getSelection()[0];
if (selection) {
this.down("#batchJobQueryFields").getStore().remove(selection);
- 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 76.
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 initComponent
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
initComponent: function () {
this.on("startEdit", this.onEditStart, this, { delay: 50 });
this.attachmentGrid = Ext.create("PartKeepr.FootprintAttachmentGrid", {
height: 200,
Method replaceTemporaryFile
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function replaceTemporaryFile(GetResponseForControllerResultEvent $event)
{
$data = $event->getControllerResult();
if (!is_object($data)) {
Function getGrid
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
getGrid: function () {
var store = this.getStore(),
pagingBar = Ext.widget('pagingtoolbar', {
store: store,
displayInfo: true,
Function appendFieldData
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
appendFieldData: function (field, node)
{
var fieldData = {};
fieldData.data = node.get("data");
Function initComponent
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
initComponent: function ()
{
this.fieldSelector = Ext.create("PartKeepr.Components.Widgets.FieldSelector", {
height: 300,
Function createGlobalStores
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
createGlobalStores: function ()
{
this.footprintStore = Ext.create("Ext.data.Store",
{
model: 'PartKeepr.FootprintBundle.Entity.Footprint',
Identical blocks of code found in 2 locations. Consider refactoring. Open
onLogout: function ()
{
this.menuBar.disable();
this.centerPanel.removeAll(true);
this.getStatusbar().setDisconnected();
- 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 75.
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
onLogout: function ()
{
this.menuBar.disable();
this.centerPanel.removeAll(true);
this.getStatusbar().setDisconnected();
- 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 75.
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