Showing 239 of 667 total issues
Method build!
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build!
data = @session_data.clone
session = nil
jobs = []
Method call
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(sessions)
sessions_array = []
sessions.map do |session|
sessions_array <<
Function updateTime
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
(selectedYear: number) => {
setUrlParams([
{
key: UrlParamsTypes.previousUserSettings,
value: isMobile ? previousUserSettings : currentUserSettings,
Function updateThumbPositionsHandler
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updateThumbPositionsHandler = useCallback(() => {
if (sliderRef.current) {
const { min, low, middle, high, max } = thresholdValues;
const lowThumb = calculateThumbPosition(
low,
Function onAdd
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
onAdd() {
this.div = document.createElement("div");
this.div.style.position = "absolute";
this.div.style.cursor = "pointer";
this.div.title = this.title;
Function initializeSentry
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const initializeSentry = () => {
let sentryEnvironment: string;
switch (window.location.hostname) {
case "aircasting.habitatmap.org":
Method sync
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sync(session_data)
tag_list = session_data[:tag_list] || ''
session_data =
session_data.merge(tag_list: SessionBuilder.normalize_tags(tag_list))
Function handleSliderClick
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleSliderClick = (
event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>
) => {
if (sliderRef.current && activeInput === null) {
const rect = sliderRef.current.getBoundingClientRect();
Function TimeRangeButtons
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TimeRangeButtons = () => {
const timeRange = useAppSelector(selectTimelapseTimeRange);
const { t } = useTranslation();
const dispatch = useAppDispatch();
Function extraReducers
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
extraReducers: (builder) => {
builder
.addCase(fetchThresholds.pending, (state) => {
state.status = StatusEnum.Pending;
state.error = null;
Function preprocessData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var preprocessData = function (data, sessions) {
var times;
_(data).each(function (session) {
if (session.start_time_local && session.end_time_local) {
Method call
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call
{
title: session.title,
username: session.is_indoor ? 'anonymous' : session.user.username,
sensorName: stream.sensor_name,
Function centerMapOnBounds
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
(
minLatitude: number,
maxLatitude: number,
minLongitude: number,
maxLongitude: number
Method save
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def save(streams)
persisted_streams =
Stream
.select(:id, :min_latitude, :min_longitude, :sensor_name, :session_id)
.joins(:session)
- 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 CopyLinkComponent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const CopyLinkComponent = ({
button,
isIconOnly,
showBelowButton,
onOpen,
- 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 CustomSensorFilter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const CustomSensorFilter: React.FC<CustomSensorFilterProps> = ({
customSensors,
sessionsCount = 0,
onClose = () => {},
fetchableSessionsCount,
- 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 getBasicSensors
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const getBasicSensors = (
measurementType: string,
sessionType: string
) => {
if (measurementType !== ParameterTypes.PARTICULATE_MATTER) {
- 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 CustomParameterFilter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const CustomParameterFilter: React.FC<CustomParameterFilterProps> = ({
customParameters,
sessionsCount = 0,
onClose = () => {},
fetchableSessionsCount,
- 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 build_measurements!
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_measurements!(data = [])
data = data.map(&:deep_symbolize_keys)
factory = RGeo::Geographic.spherical_factory(srid: 4326)
time_zone = time_zone(data)
Function setStartDate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
setStartDate: function (startDate) {
if (typeof startDate === "string")
this.startDate = moment(startDate, this.locale.format);
if (typeof startDate === "object") this.startDate = moment(startDate);