Showing 239 of 667 total issues
Method sync
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def sync(data)
upload = []
deleted = []
data.each do |session_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 getXAxisOptions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const getXAxisOptions = (
isMobile: boolean,
rangeDisplayRef: React.RefObject<HTMLDivElement> | undefined,
fixedSessionTypeSelected: boolean,
isIndoor: string | null,
- 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 updateCalendars
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateCalendars: function () {
if (this.timePicker) {
var hour, minute, second;
if (this.endDate) {
hour = parseInt(this.container.find(".left .hourselect").val(), 10);
Function init
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const init = () => {
const element = document.getElementById("map11");
if (!element) {
return setTimeout(init, 100);
}
Function timeChanged
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
timeChanged: function (e) {
var cal = $(e.target).closest(".drp-calendar"),
isLeft = cal.hasClass("left");
var hour = parseInt(cal.find(".hourselect").val(), 10);
Function applyStyles
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private applyStyles() {
if (!this.div) return;
this.div.innerHTML = "";
Function fetch
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetch: function (values = {}) {
if (params.isSessionSelected()) return;
const limit = values.amount || 100;
const offset = values.fetchedSessionsCount || 0;
Function googleMaps
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const googleMaps = () => {
let onPanOrZoomHandle;
let onPanOrZoomCallback = () => {};
const unlistenPanOrZoom = (mapObj) =>
Function filterTimestamps
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const filterTimestamps = (
timestamps: { [timestamp: string]: any },
timeRange: TimeRanges
): string[] => {
const now = moment.utc();
Method perform
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
alerts = ThresholdAlert.all
Sidekiq.logger.info "[TRSHLD] #{alerts.count} alerts found: #{alerts.inspect}"
alerts.each do |alert|
Function updateIndoorFilters
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
(isIndoor: string) => {
if (isMobile) {
setUrlParams([
{
key: UrlParamsTypes.isIndoor,
Function getClusterPixelPosition
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getClusterPixelPosition = (
map: google.maps.Map,
latLng: google.maps.LatLng
) => {
const zoom = map.getZoom();
Function UniformDistributionButton
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const UniformDistributionButton: React.FC<UniformDistributionButtonProps> = ({
variant = ThresholdButtonVariant.IconOnly,
uniformDistributionButtonText,
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
Function fetch
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetch: function (values = {}) {
if (params.isSessionSelected()) return;
const limit = values.amount || 100;
const offset = values.fetchedSessionsCount || 0;
Method sync
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sync(data)
upload = []
deleted = []
data.each do |session_data|
Method as_json
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def as_json(opts = nil)
opts ||= {}
methods = opts[:methods] || %i[notes]
methods << :type
Function exports
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (webpackConfig) => {
webpackConfig.devtool = "cheap-module-source-map"
webpackConfig.stats = {
colors: true,
Function createSessionFetchThunk
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSessionFetchThunk = (
type: FixedSessionsTypes,
endpoint: (filters: string) => string
) => {
return createAsyncThunk<
Function createSessionFetchThunk
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSessionFetchThunk = (
type: FixedSessionsTypes,
endpoint: (filters: string) => string
) => {
return createAsyncThunk<
Function FixedStreamStationHeader
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FixedStreamStationHeader = () => {
const {
unitSymbol,
title,
profile,