Showing 91 of 91 total issues
File dataCenters.ts
has 1458 lines of code (exceeds 250 allowed). Consider refactoring. Open
export const dataCenters = [
{
group: "Africa",
name: "Antananarivo, Madagascar",
id: "TNR",
Similar blocks of code found in 2 locations. Consider refactoring. Open
<div className="lg:col-start-2">
<h4 className="text-2xl leading-8 font-extrabold text-gray-900 tracking-tight sm:text-3xl sm:leading-9">
WebSockets
</h4>
<p className="mt-3 text-lg leading-7 text-gray-500">
- 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 440.
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 className="lg:col-start-2">
<h4 className="text-2xl leading-8 font-extrabold text-gray-900 tracking-tight sm:text-3xl sm:leading-9">
Editor
</h4>
<p className="mt-3 text-lg leading-7 text-gray-500">
- 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 440.
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 Home
has 405 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Home = () => {
const { hasToken, hasKey } = useSettings();
if (hasKey || hasToken) return <Redirect to="/accounts" />;
Function Settings
has 302 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Settings = forwardRef((props, ref) => {
const homeMatch = useRouteMatch({
path: "/",
exact: true,
}) as Record<string, any>;
Function Analytics
has 286 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Analytics = () => {
const { workerID: scriptID, accountID } = useParams();
const now = new Date();
const defaultDateFrom = new Date(now);
Function Container
has 247 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Container = () => {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const [profileDropdownOpen, setProfileDropdownOpen] = useState(false);
const location = useLocation();
File Analytics.tsx
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from "react";
import Plot from "react-plotly.js";
import { BigStatus } from "../BigStatus";
import { useQuery, gql } from "@apollo/client";
import { useParams } from "react-router-dom";
File Home.tsx
has 413 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from "react";
import { Link, Redirect } from "react-router-dom";
import { ExampleEditor } from "../components/home/ExampleEditor";
import { ExampleAnalytics } from "../components/home/ExampleAnalytics";
import { ExamplePeek } from "../components/home/ExamplePeek";
Function Worker
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Worker: FC = () => {
const { workerID: scriptID, accountID } = useParams();
const { path, url } = useRouteMatch();
const history = useHistory();
const location = useLocation();
Function analyticsToSeries
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
const analyticsToSeries = (analytics: any, interval: string) => {
const min = {
x: [] as Date[],
y: [] as number[],
type: "scatter",
File analytics.ts
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
import gql from "graphql-tag";
import {
GraphQLResolveInfo,
DocumentNode,
FieldNode,
Function Workers
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Workers: FC<{}> = ({}) => {
const { url } = useRouteMatch();
const { accountID } = useParams();
const { loading, error, data } = useQuery(WORKERS_QUERY, {
variables: { accountID },
File Settings.tsx
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
useState,
forwardRef,
useImperativeHandle,
createRef,
File ExamplePeek.tsx
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState, useReducer } from "react";
import Plot from "react-plotly.js";
type Location = {
location: string;
File Container.tsx
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect, useRef, createRef } from "react";
import { Transition } from "../components/lib/Transition";
import { useWindowKey } from "../hooks/useWindowKey";
import { classNames } from "../utils/classNames";
import { useMouseOutside } from "../hooks/useMouseOutside";
Similar blocks of code found in 2 locations. Consider refactoring. Open
{
x: [0, 0.25, 0.5, 0.75, 0.9, 0.99, 0.999, 1],
y: [380, 1054, 1535, 1843, 2303.4, 3113.2, 3638.56, 3815].map(
(y) => y / 1000
),
- 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 88.
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
{
x: [0, 0.25, 0.5, 0.75, 0.9, 0.99, 0.999, 1],
y: [201, 240.2, 609, 2800, 3732, 4678, 4800, 4900].map((y) => y / 1000),
type: "scatter",
name: "error",
- 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 88.
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 Accounts
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Accounts: FC<{}> = ({}) => {
const { url } = useRouteMatch();
const { state: { autoSelect } = { autoSelect: false } } = useLocation();
const { loading, error, data } = useQuery(ACCOUNTS_QUERY);
Similar blocks of code found in 2 locations. Consider refactoring. Open
<svg
className={classNames(
"h-6 w-6",
mobileMenuOpen ? "hidden" : "block"
)}
- 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 73.
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