Showing 14,752 of 14,752 total issues
Method saveSettingsTo
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void saveSettingsTo(NodeSettingsWO settings) {
File directory =
NodeContext.getContext().getWorkflowManager().getContext().getCurrentLocation();
- Create a ticketCreate a ticket
Method execute
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected PortObject[] execute(PortObject[] inObjects, ExecutionContext exec) throws Exception {
exec.setMessage("Reading subworkflow");
final WorkflowContext origContext = NodeContext.getContext().getWorkflowManager().getContext();
NodeContext nodeContext = NodeContext.getContext();
- Create a ticketCreate a ticket
Method execute
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected PortObject[] execute(PortObject[] inObjects, ExecutionContext exec) throws Exception {
exec.setMessage("Reading subworkflow");
final WorkflowContext origContext = NodeContext.getContext().getWorkflowManager().getContext();
NodeContext nodeContext = NodeContext.getContext();
- Create a ticketCreate a ticket
Method checkAndRegenerateSimulation
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void checkAndRegenerateSimulation(List<FskSimulation> simulations,
List<Parameter> originalParameters, List<Parameter> newParams) {
List<Parameter> paramsToBeRemoved =
(List<Parameter>) CollectionUtils.removeAll(originalParameters, newParams);
List<Parameter> viewParams = (List<Parameter>) CollectionUtils.removeAll(newParams, originalParameters);
- Create a ticketCreate a ticket
File ColumnDocumentImpl.java
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* An XML document type.
* Localname: Column
* Namespace: http://www.bfr.bund.de/PCML-1_0
* Java type: de.bund.bfr.pcml10.ColumnDocument
- Create a ticketCreate a ticket
Method loadFrom
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
void loadFrom(final InputStream is)
throws IOException, XmlException {
// use NonClosableInputStream to prevent multiple calling of close.
// We do it in the next line.
XmlObject xmlDoc = PCMLDocument.Factory.parse(
- Create a ticketCreate a ticket
Function token
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
token: function (stream, state) {
//check for state changes
if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) {
state.stringType = stream.peek();
stream.next(); // Skip quote
- Create a ticketCreate a ticket
Function _createSimplePanel
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createSimplePanel(menu, modelHandler) {
let O = this;
_log('MODAL DETAILS / _createSimplePanel: ' + menu.id);
// tab-pane
- Create a ticketCreate a ticket
Function _createTableHead
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createTableHead(cols) {
let O = this;
_log('TABLE / _createTableHead');
// thead
let $thead = $('<thead></thead>');
- Create a ticketCreate a ticket
Function convertToValue
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
convertToValue: function (percent) {
var min = this.options.min,
max = this.options.max,
min_decimals = min.toString().split(".")[1],
max_decimals = max.toString().split(".")[1],
- Create a ticketCreate a ticket
Function parse
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: function( red, green, blue, alpha ) {
if ( red === undefined ) {
this._rgba = [ null, null, null, null ];
return this;
}
- Create a ticketCreate a ticket
Function keydown
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
keydown: function( event ) {
if ( this.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
suppressInput = true;
suppressKeyPressRepeat = true;
- Create a ticketCreate a ticket
Function markText
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function markText(doc, from, to, options, type) {
// Shared markers (across linked documents) are handled separately
// (markTextShared will call out to this again, once per
// document).
if (options && options.shared) { return markTextShared(doc, from, to, options, type) }
- Create a ticketCreate a ticket
Function markText
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function markText(doc, from, to, options, type) {
// Shared markers (across linked documents) are handled separately
// (markTextShared will call out to this again, once per
// document).
if (options && options.shared) { return markTextShared(doc, from, to, options, type) }
- Create a ticketCreate a ticket
Function 19
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],19:[function(require,module,exports){
'use strict';
module.exports = function generate_const(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
- Create a ticketCreate a ticket
Function rules
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function rules() {
var RULES = [
{ type: 'number',
rules: [ { 'maximum': ['exclusiveMaximum'] },
{ 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] },
- Create a ticketCreate a ticket
Function decode
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function decode(input) {
// Don't use UCS-2
var output = [],
inputLength = input.length,
out,
- Create a ticketCreate a ticket
Function resolveComponents
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resolveComponents(base, relative) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var skipNormalization = arguments[3];
var target = {};
- Create a ticketCreate a ticket
Function update
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function(){
if (!this._allow_update)
return this;
var oldDates = this.dates.copy(),
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
@Override
protected void reset() {
NodeContext nodeContext = NodeContext.getContext();
WorkflowManager wfm = nodeContext.getWorkflowManager();
WorkflowContext workflowContext = wfm.getContext();
- Read upRead up
- Create a ticketCreate a ticket
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 137.
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