Showing 2,136 of 2,138 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
const includedActivities = activities.map(function (activity: any, index: number) {
return (
<span key={index}>
<em>
{ activity.name }
- 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 68.
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
const includedActivities = activities.map(function (activity: any, index: any) {
return (
<span key={index}>
<em>
{ activity.name }
- 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 68.
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 3 locations. Consider refactoring. Open
@Authorized()
@Query(() => PortalPermissionForm)
PortalPermissionForm(@Arg("id") id: string) {
return PortalPermissionForm.findOne({ where: { id }, relations: ["project"]});
}
- 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 68.
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 parseCss
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseCss: function( css ) {
var w = {},
s = {},
c = {},
active = false,
Function Sizzle
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Sizzle( selector, context, results, seed ) {
results = results || [];
context = context || document;
var match, elem, xml, m,
nodeType = context.nodeType;
Function val
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
val: function( value ) {
var hooks, ret, isFunction,
elem = this[0];
if ( !arguments.length ) {
Function setOptions
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
setOptions: function(options) {
this.options = Object.extend({
choices: 10,
partialSearch: true,
partialChars: 2,
Function drawHit
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawHit: function(n){
var octx = this.octx,
s = n.series,
tHoz = this.tHoz.bind(this),
tVert = this.tVert.bind(this);
Function drawHit
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawHit: function(n){
var octx = this.octx,
s = n.series,
tHoz = this.tHoz.bind(this),
tVert = this.tVert.bind(this);
Method elastic_search_learner_model
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def elastic_search_learner_model
{
learner_id: self.id,
report_learner_id: self.report_learner_only_id.id,
student_id: self.student.id,
Method show
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
@offering = Portal::Offering.find(params[:id])
authorize @offering
respond_to do |format|
Method update
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
cancel = params[:commit] == "Cancel"
@interactive = Interactive.find(params[:id])
authorize @interactive
Method update
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
cancel = params[:commit] == "Cancel"
@external_activity = ExternalActivity.find(params[:id])
authorize @external_activity
Function renderForm
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderForm () {
const { externalReports } = this.props;
const { queryParams, externalReportButtonDisabled } = this.state;
// ...LEARNER_QUERY is the renamed ...REPORT_QUERY, use a fallback to wait for the portal to update
const learnerQueryUrl = Portal.API_V1.EXTERNAL_RESEARCHER_REPORT_LEARNER_QUERY || Portal.API_V1.EXTERNAL_RESEARCHER_REPORT_QUERY;
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { needMoreTeachers } = this.state;
const { currentTeachers, unassignedTeachers } = this.state;
return (
Function positionBgImage
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
positionBgImage: function( shape, index ) {
var me = this;
PIE.Util.withImageSize( shape.fill.src, function( size ) {
var el = me.targetElement,
bounds = me.boundsInfo.getBounds(),
Function stop
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
stop: function( type, clearQueue, gotoEnd ) {
var stopQueue = function( hooks ) {
var stop = hooks.stop;
delete hooks.stop;
stop( gotoEnd );
Function on
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
var origFn, type;
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
Function extend
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
Function set_up_html
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Chosen.prototype.set_up_html = function() {
var container_classes, container_props;
container_classes = ["chosen-container"];
container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
if (this.inherit_select_classes && this.form_field.className) {