Showing 92 of 413 total issues
Function CollectedInks
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
export const CollectedInks = ({ archive }) => {
const [inks, setInks] = useState();
useEffect(() => {
async function getCollectedInks() {
- 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 dist
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const dist = (macroClusterInks, microClusterInks) => {
const calc1 = (c1, c2) =>
minLev(c1.brand_name, c2.brand_name) +
0.5 * minLev(c1.line_name, c2.line_name) +
minLev(c1.ink_name, c2.ink_name);
Method to_csv
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.to_csv
CSV.generate(col_sep: ";") do |csv|
csv << [
"Brand",
"Line",
Function getMacroClusters
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getMacroClusters = (dispatch) => {
let data = [];
const formatter = new Jsona();
function run(page = 1) {
loadMacroClusterPage(page).then((json) => {
Function getMacroClusters
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getMacroClusters = (dispatch) => {
let data = [];
const formatter = new Jsona();
function run(page = 1) {
loadMacroClusterPage(page).then((json) => {
Function getMacroClusters
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getMacroClusters = (dispatch) => {
let data = [];
const formatter = new Jsona();
function run(page = 1) {
loadMacroClusterPage(page).then((json) => {
Method to_csv
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.to_csv
CSV.generate(col_sep: ";") do |csv|
csv << [
"Used On",
"Pen Brand",
Function InksVisualizationWidgetContent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InksVisualizationWidgetContent = () => {
const { data } = useContext(WidgetDataContext);
const [includeArchived, setIncludeArchived] = useState(false);
const width = useContext(WidgetWidthContext);
return (
Function CurrentlyInked
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const CurrentlyInked = () => {
const [currentlyInked, setCurrentlyInked] = useState();
useEffect(() => {
async function getData() {
Function getMicroClusters
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getMicroClusters = (dispatch) => {
const formatter = new Jsona();
let data = [];
function run(page = 1) {
loadMicroClusterPage(page).then((json) => {
Function getMicroClusters
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getMicroClusters = (dispatch) => {
const formatter = new Jsona();
let data = [];
function run(page = 1) {
loadMicroClusterPage(page).then((json) => {
Function PenCard
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
export const PenCard = (props) => {
const {
hiddenFields,
id,
brand,
- 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 ink_data
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def ink_data
CSV.generate do |csv|
csv << [
"ink name",
"last usage",
Function createMacroClusterAndAssign
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const createMacroClusterAndAssign = (
values,
microClusterId,
dispatch,
afterCreate
Function SignUps
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const SignUps = () => {
const [data, setData] = useState(null);
useEffect(() => {
fetch("/admins/graphs/signups.json")
.then((res) => res.json())
Function UsageRecords
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const UsageRecords = () => {
const [data, setData] = useState(null);
useEffect(() => {
fetch("/admins/graphs/usage-records.json")
.then((res) => res.json())
Function CollectedInks
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const CollectedInks = () => {
const [data, setData] = useState(null);
useEffect(() => {
fetch("/admins/graphs/collected-inks.json")
.then((res) => res.json())
Function Spam
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Spam = () => {
const [data, setData] = useState(null);
useEffect(() => {
fetch("/admins/graphs/spam.json")
.then((res) => res.json())
Function run
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function run(page = 1) {
loadMacroClusterPage(page).then((json) => {
const pagination = json.meta.pagination;
dispatch({
type: SET_LOADING_PERCENTAGE,
Function CollectedPens
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const CollectedPens = () => {
const [data, setData] = useState(null);
useEffect(() => {
fetch("/admins/graphs/collected-pens.json")
.then((res) => res.json())