Showing 122 of 840 total issues
File trap_repeat_if_done_spec.rb
has 599 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'sample_agent_test_configuration'
describe TrapRepeatIfDone do
include_context 'use agent_setting'
File range_break_checker_spec.rb
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'sample_agent_test_configuration'
describe RangeBreakChecker do
include_context 'use agent_setting'
Function createContnet
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createContnet() {
const summary = this.state.summary;
if (!summary) {
return <div className="center-information loading">
<LoadingImage left={-20}/>
CoordinateCalculator
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class CoordinateCalculator extends Observable {
constructor() {
super();
}
Function render
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
if (this.state.loading) {
return <div className="backtest-builder center-information loading">
<LoadingImage left={-20}/>
</div>;
File cointegration_trader_spec.rb
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'sample_agent_test_configuration'
require 'statistical_arbitrage/shared_context'
describe StatisticalArbitrage::CointegrationTrader do
include_context 'utils for statistical arbitrage'
File statistical_arbitrage_agent.rb
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'quandl'
require 'lru_redux'
# === 統計的裁定取引エージェント
class StatisticalArbitrageAgent
Slider
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class Slider extends Observable {
constructor(context, coordinateCalculator, preferences) {
super();
this.context = context;
LoginPageModel
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class LoginPageModel extends AbstractPageModel {
constructor() {
super();
this.authenticator = ContainerJS.Inject;
SMTPServerSettingModel
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class SMTPServerSettingModel extends Observable {
constructor(smtpServerSettingService, timeSource) {
super();
this.smtpServerSettingService = smtpServerSettingService;
TableModel
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class TableModel extends Observable {
constructor(defaultSortOrder, pageSize=100) {
super();
this.pageSize = pageSize;
Function createDetailsView
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createDetailsView( position ) {
const closingPolicy = position.closingPolicy || nullPosition.closingPolicy;
return (
<div className="position-details">
<div className="profit-or-loss">
Function createPasswordResetterPanel
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createPasswordResetterPanel() {
return <div className="password-resetter">
<div className="login-link">
<a onClick={() => this.setState({showPasswordResetter:false})}>
← ログイン画面に戻る
BacktestBuilder
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class BacktestBuilder extends Observable {
constructor() {
super();
File trailing_stop_manager_spec.rb
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'sample_agent_test_configuration'
describe TrailingStopManager do
include_context 'use agent_setting'
Function render
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div className="mailaddress-and-password-setting-view">
<h3>メールアドレスとパスワードの設定</h3>
<div className="description">
TradingSummaryModel
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class TradingSummaryModel extends Observable {
constructor(summary) {
super();
_.pairs(summary).forEach(
InitialSettingsPageModel
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class InitialSettingsPageModel extends Observable {
constructor() {
super();
this.viewModelFactory = ContainerJS.Inject;
CandleSticks
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class CandleSticks extends Observable {
constructor(coordinateCalculator, rates, preferences, pairSelector) {
super();
this.rates = rates;
Method collect_properties
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def collect_properties(keys = instance_variables.map { |n| n[1..-1].to_sym })
keys.each_with_object({}) do |name, obj|
next if name == :broker
v = instance_variable_get("@#{name}")
- 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"