Showing 17 of 52 total issues
Function render
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const bot = this.state.bot;
if (bot === null) {
return <div className="trading-card-horizontal">
<LoadingAnimation/>
Function render
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let new_season_id = this.context.selected.id;
if(this.state.old_season != new_season_id)
this.updateResultData(new_season_id);
let rows = this.initPageNumbers();
Function renderActiveShape
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderActiveShape = (p) => {
const { cx, cy, midAngle, innerRadius, outerRadius, startAngle, endAngle,
fill, payload, percent, value } = p;
const sin = Math.sin(-RADIAN * midAngle);
const cos = Math.cos(-RADIAN * midAngle);
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<ModalContext.Consumer>{modal => <div className="trading-card-horizontal">
<UserTitle user={this.state.profile}/>
<div className="flex-horizontal">
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let headerClass = "navbar";
headerClass += (this.state.navbarExpanded) ? " expanded" : " collapsed";
let toggleClass = "toggle-bar";
toggleClass += (this.state.navbarExpanded) ? " expanded" : " collapsed";
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let password_token = this.getPasswordToken();
if(password_token != "")
return <form name="form-password-reset"
className="flex-vertical form-container"
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<form name="form-signup"
className="flex-vertical form-container"
onSubmit={this.onSubmit}>
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
// If we have recieved data, filter and sort the data.
let bot_table = this.props.bots;
return <ModalContext.Consumer>{modalContext =>
<CustomReactTable table={bot_table} nullMessage="No bots found for user">
Function drawPoints
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawPoints() {
if(!this.canvas) return;
const canvas = this.canvas;
canvas.width = this.state.width;
canvas.height = this.state.height;
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let width = this.props.width || 200;
let height = this.props.height || 300;
let offset = -(400 - width)/2;
let style= { top: "-25px" };
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const search = this.props.location.search;
const params = new URLSearchParams(search);
let entry_list = [];
for(let pair of params.entries()) entry_list.push(pair);
Method initialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def initialize(user)
signed_in = user.present?
user ||= User.new
can :read, :all
- 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
Function UNSAFE_componentWillReceiveProps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
UNSAFE_componentWillReceiveProps(props) {
// If we have not yet recieved a table, there is nothing to do.
if(props.table === null) return;
// If the prop has removed the element, update the state.
for(let c of this.state.table) {
- 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 game_result_params
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def game_result_params
p = params.permit(:map, :replayfile, :winner_id, :gba)
if params.key? :gba
p[:bot_ids] = JSON.parse(params[:gba])
else
- 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
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
let bot = this.props.bot;
let uploadPath = `/bots${bot ? `/${bot.id}` : ""}`;
return <FormZone uploadPath={uploadPath} method={this.props.method}>
<h3>{this.props.label}</h3>
- 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
Function UNSAFE_componentWillReceiveProps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
UNSAFE_componentWillReceiveProps(props) {
// If the prop has removed the element, update the state
for(let message of this.state.messages) {
if(!props.messages.find(e => e.id === message.id))
this._deleteMessage(message);
- 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 update_download_zip_if_necessary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_download_zip_if_necessary
Zip::File.open(bots_zip_path, Zip::File::CREATE) do |zipfile|
self.bots.each do |bot|
# Two arguments:
# - The name of the file as it will appear in the archive
- 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"