Showing 82 of 377 total issues
Function BotSignUps
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const BotSignUps = () => {
const [data, setData] = useState(null);
useEffect(() => {
fetch("/admins/graphs/bot-signups.json")
.then((res) => res.json())
Function createMacroClusterAndAssign
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createMacroClusterAndAssign = (
values,
microClusterId,
dispatch,
afterCreate
Function CurrentlyInked
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const CurrentlyInked = () => {
const [currentlyInked, setCurrentlyInked] = useState();
useEffect(() => {
async function getData() {
- 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 perform
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def perform(collected_ink_id, macro_cluster_id = nil)
collected_ink = CollectedInk.find(collected_ink_id)
cluster =
MicroCluster.find_or_create_by!(
simplified_brand_name: collected_ink.simplified_brand_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"
Further reading
Function CollectedPens
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const CollectedPens = () => {
const [pens, setPens] = useState();
useEffect(() => {
async function getCollectedPens() {
- 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 tableData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
tableData() {
let ld = this.state.loggedInUserData;
let ud = this.state.userData;
let additionalData = ld.user_id && ld.user_id != ud.user_id;
if (additionalData) {
Function getMicroClusters
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getMicroClusters = (dispatch) => {
const formatter = new Jsona();
let data = [];
function run(page = 1) {
loadMicroClusterPage(page).then((json) => {
Function PensSummaryWidgetContent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PensSummaryWidgetContent = () => {
const { data } = useContext(WidgetDataContext);
const { count, archived } = data.attributes;
return (
<>
Function run
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function run(page = 1) {
loadMicroClusterPage(page).then((json) => {
const pagination = json.meta.pagination;
dispatch({
type: SET_LOADING_PERCENTAGE,
Function inkConfig
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
inkConfig() {
return {
...this.defaultConfig("ink_name"),
Cell: ({ value, original: { ink_id } }) => {
return (
Method simplify
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.simplify(name, too_short: false)
without_no = name.gsub(/^no\s*\.\s*(\d+)/i, '\1')
return $1 if without_no =~ /^#?(\d+)$/
without_no = without_no.gsub(/^#(\d+)/, '\1') unless too_short
without_initials = remove_initials(without_no)
- 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 image
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def image
image =
document
.at_css('meta[property="og:image"]')
&.attribute("content")
- 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 fetch_videos
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fetch_videos
Enumerator
.new do |yielder|
result = client.list_playlist_items("snippet", playlist_id: uploads_id)
loop do
- 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 comparisonConfig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
comparisonConfig() {
return {
Header: "Compare",
accessor: "comparison",
show: this.props.additionalData,
- 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 actualReducer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const actualReducer = (state, { type, payload }) => {
switch (type) {
case ADD_MACRO_CLUSTER:
return {
...state,
- 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 ActualInkAddButton
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ActualInkAddButton = ({ macro_cluster_id, inCollection, detailView }) => {
const [state, setState] = useState(null);
const [kind, setKind] = useState("bottle");
const add = () => {
setState("adding");
- 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 params
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def params(row)
row.keys.each do |k|
row[k] = "" if row[k].nil?
row[k] = row[k].strip
end
- 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 CurrentlyInkedCard
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const CurrentlyInkedCard = (props) => {
const {
hiddenFields,
id,
comment,
- 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
Avoid too many return
statements within this method. Open
return "pensalley" if simplified =~ /pensalley/
Avoid too many return
statements within this method. Open
return "bril" if name =~ /^bril/i