Showing 7,504 of 7,504 total issues
Similar blocks of code found in 3 locations. Consider refactoring. Open
[HttpGet]
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "None")]
public JsonResult Participant(Guid participantId)
{
Response.AppendHeader("Access-Control-Allow-Origin", "*");
- 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 95.
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 _
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
, callback: _wrap(function _(err, base64){
api.log('FlashAPI.Image._apply.callback:', err);
_unwrap(_);
if( err ){
Function lazyLoadChunks
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
lazyLoadChunks: function( size, delay ) {
var len = this.getDataLength(),
i = 0,
n = 0,
Function trackPageViewInternal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
AppInsights.prototype.trackPageViewInternal = function (name, url, properties, measurements) {
var _this = this;
var durationMs = 0;
if (ApplicationInsights.Telemetry.PageViewPerformance.isPerformanceTimingSupported()) {
var startTime = window.performance.timing.navigationStart;
Function decrementCount
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
wp.updates.decrementCount = function( upgradeType ) {
var count, pluginCount, $elem;
$elem = $( '#wp-admin-bar-updates .ab-label' );
count = $elem.text();
Function _audioVideo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_audioVideo: function( type, props, attachment ) {
var shortcode, html, extension;
props = wp.media.string.props( props, attachment );
if ( props.link !== 'embed' )
Function _wp_Nop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_wp_Nop : function(content) {
var blocklist1, blocklist2;
// Protect pre|script tags
content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
Function save
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
save : function(postid, nonce) {
var data, target = this.getTarget(postid), history = this.filterHistory(postid, 0);
if ( '' == history )
return false;
Function slide
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
slide: function( event, ui ) {
var attributes, movedRevision;
// Compare two revisions mode
if ( this.model.get('compareTwoMode') ) {
// Prevent sliders from occupying same spot
Function insert
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
insert: function( html ) {
var editor,
hasTinymce = ! _.isUndefined( window.tinymce ),
hasQuicktags = ! _.isUndefined( window.QTags ),
wpActiveEditor = window.wpActiveEditor;
Function clean
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.clean = function( elems, context, fragment, scripts ) {
// Set context per 1.8 logic
context = context || document;
context = !context.nodeType && context[0] || context;
context = context.ownerDocument || context;
Function PopupWindow_refresh
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PopupWindow_refresh() {
if (this.divName != null) {
// refresh the DIV object
if (this.use_gebi) {
document.getElementById(this.divName).innerHTML = this.contents;
Function add
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.add = function(callback, scope, prepend) {
log('<target>.on' + newEventName + ".add(..)");
// Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
function patchedEventCallback(e) {
Function removeWebKitStyles
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function removeWebKitStyles(content) {
// Passthrough all styles from Word and let the WordFilter handle that junk
if (WordFilter.isWordContent(content)) {
return content;
}
Function renderUI
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.renderUI = function(args) {
var skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
if (skin) {
var skinUrl = settings.skin_url;
Function setupBDDExtensionMethods
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Test.setupBDDExtensionMethods = function(){
var METHODMAP = {
shouldEqual: 'assertEqual',
shouldNotEqual: 'assertNotEqual',
shouldEqualEnum: 'assertEnumEqual',
Function setErrorState
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setErrorState( error, status ) {
var trigger;
if ( error ) {
switch ( error ) {
Function simulateMouse
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Event.simulateMouse = function(element, eventName) {
var options = Object.extend({
pointerX: 0,
pointerY: 0,
buttons: 0,
Function open
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
open: function( editorId ) {
var ed;
wpLink.range = null;
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [