Showing 239 of 667 total issues
Avoid deeply nested control flow statements. Open
if (isActive) {
dispatch(
fetchActiveIndoorSessions({ filters: indoorSessionsFilters })
).unwrap();
} else {
Avoid deeply nested control flow statements. Open
if (isActive) {
dispatch(fetchActiveFixedSessions({ filters })).unwrap();
} else {
dispatch(fetchDormantFixedSessions({ filters })).unwrap();
}
Function TimelapseComponent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
> = React.memo(({ onClose }) => {
const [showReadOnlyPopup, setShowReadOnlyPopup] = useState(false);
const [currentStep, setCurrentStep] = useState(0);
const isLoading = useAppSelector(selectTimelapseIsLoading);
- 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 getMonthWeeksOfDailyAveragesFor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getMonthWeeksOfDailyAveragesFor = (
month: Moment,
streamDailyAverages: StreamDailyAverage[]
): CalendarMonthlyData => {
if (!month || !month.isValid() || !streamDailyAverages) {
- 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 CrowdMapMarkers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const CrowdMapMarkers = ({ pulsatingSessionId, sessions }: Props) => {
const dispatch = useAppDispatch();
const crowdMapRectangles = useAppSelector(selectCrowdMapRectangles);
const fetchingCrowdMapData = useAppSelector(selectFetchingCrowdMapData);
- 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_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
amount_of_streams,
measurements,
sensor_package_name,
session_id,
stream_parameters
Method build_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
amount_of_streams,
measurements,
sensor_package_name,
session_id,
stream_parameters
Function updatePane
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private updatePane() {
if (!this.div) return;
const panes = this.getPanes();
if (panes) {
if (this.div.parentElement) {
- 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 show
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def show
GoogleAnalyticsWorker::RegisterEvent.async_call('Mobile regions#show')
data = params.to_unsafe_hash
data[:stream_ids] ||= []
- 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 createMobileSeriesData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const createMobileSeriesData = (
data: Session[] | Measurement[],
isGraphData: boolean
) =>
data
- 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 getChartOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getChartOptions = (
isCalendarPage: boolean,
isMobile: boolean
): ChartOptions => {
const zoomingConfig: ChartZoomingOptions = {
- 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 prepare_range
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def prepare_range(name, field)
scope name,
lambda { |low, high|
if low && high
if low <= high
- 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 getClusterPixelPosition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getClusterPixelPosition = (
map: google.maps.Map,
latLng: google.maps.LatLng
) => {
const zoom = map.getZoom();
- 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!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build!
data = @session_data.clone
session = nil
jobs = []
- 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 MobileHeader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const MobileHeader = ({
isTimelapseView,
toggleMenuVisibility,
navMenuVisible,
t,
- 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 DormantMarkers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const DormantMarkers: React.FC<DormantMarkersProps> = ({
sessions,
onMarkerClick,
selectedStreamId,
pulsatingSessionId,
- 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 ThresholdButton
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ThresholdButton: React.FC<ThresholdButtonProps> = ({
variant = ThresholdButtonVariant.IconOnly,
buttonText,
swapIconTextPosition = false,
useDarkBlueIcon = false,
- 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 function. Open
return 5;
Avoid too many return
statements within this function. Open
return "highest";
Avoid too many return
statements within this function. Open
return 4;