Showing 922 of 922 total issues
Class Retrieval
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Retrieval < Operation
include Measurable
belongs_to :source, optional: false
belongs_to :import, class_name: "Import::Workbench"
Class User
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ApplicationModel
extend Enumerize
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable, :database_authenticatable
Class ReferentialsController
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class ReferentialsController < Chouette::WorkbenchController
defaults :resource_class => Referential
respond_to :html
respond_to :json, :only => :show
Class Context
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Context
include Log
attr_writer :attributes
attr_accessor :instance, :instance_name, :parent
Method each
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def each(collection_or_opts={}, opts = {})
if collection_or_opts.is_a? Hash
collection = nil
opts = collection_or_opts
else
Similar blocks of code found in 2 locations. Consider refactoring. Open
case 'UNSELECT_CP_EDIT_MODAL':
vehicleJourney = _.assign({}, state.modalProps.vehicleJourney, {company: undefined})
newModalProps = _.assign({}, state.modalProps, {vehicleJourney})
return _.assign({}, state, {modalProps: newModalProps})
- 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 84.
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
case 'UNSELECT_SHAPE_EDIT_MODAL':
journeyPattern = _.assign({}, state.modalProps.journeyPattern, {shape: undefined})
newModalProps = _.assign({}, state.modalProps, {journeyPattern})
return _.assign({}, state, {modalProps: newModalProps})
- 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 84.
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 render
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="container-fluid">
<div className="row">
<div className="col xs-9 col-xs-offset-3">
Function CopyModal
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const CopyModal = props => {
const copyContentRef = useRef(null)
const pasteContentRef = useRef(null)
const {
- 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
Method save_model
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def save_model(model, filename: nil, line_number: nil, column_number: nil, resource: nil)
return unless model.changed?
if resource
filename ||= "#{resource.name}.txt"
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
<div>
<div className="form-group">
<label htmlFor="" className="control-label required">
{I18n.t('time_tables.edit.period_form.begin')}
<abbr title="requis">*</abbr>
- 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 83.
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
<div>
<div className="form-group">
<label htmlFor="" className="control-label required">
{I18n.t('time_tables.edit.period_form.end')}
<abbr title="requis">*</abbr>
- 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 83.
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 VehicleJourneysList.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { flatMap, isEmpty, map, some, uniqBy } from 'lodash'
import autoBind from 'react-autobind'
import VehicleJourney from './VehicleJourney'
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.props.status.isFetching == true) return false
if (this.props.status.fetchSuccess == true) {
return (
Class Scheduled
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Scheduled < Base
attr_writer :final_scope
def final_scope
@final_scope || current_scope
Class Mapper
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Mapper
def initialize(source_referential, target_referential, table_name, legacy_id: true, where: nil)
@table_name = table_name
@source_referential = source_referential
@target_referential = target_referential
Class ReferentialSchema
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class ReferentialSchema
include Measurable
PUBLIC_SCHEMA = 'public'
Class Base
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
class << self
def strategy_classes
@strategy_classes ||= {}
end
Function render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div>
{ this.props.values.map((code, index) =>
<div className="row vertical-align" key={code.id || code.fallback_id}>
Method import_routes
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import_routes
@lines_by_registration_number = {}
CustomFieldsSupport.within_workgroup(workbench.workgroup) do
create_resource(:routes).each(source.routes, transaction: true) do |route, resource|