Showing 239 of 667 total issues
Function fetchUsernames
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchUsernames: (params) => {
const {
usernames,
tags,
west,
Function updateMonthsInView
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateMonthsInView: function () {
if (this.endDate) {
//if both dates are visible already, do nothing
if (
!this.singleDatePicker &&
Function sharedWebpackConfig
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
const sharedWebpackConfig = (mode) => {
const isProduction = mode === "production";
const hash = isProduction ? "-[contenthash]" : "";
const publicPath = isProduction
? `/${publicOutputPath}/`
Function updateSessionType
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
(selectedSessionType: SessionType) => {
setUrlParams([
{ key: UrlParamsTypes.sessionType, value: selectedSessionType },
{
key: UrlParamsTypes.previousUserSettings,
Method call
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(server:, token:, amount:, session_name:)
now = Time.current
data = {
calibration: 100,
contribute: true,
Function fetchTags
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchTags: (params) => {
const {
tags,
west,
east,
Function params
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const params = () => {
var Params = function () {
this.init(getParams2());
};
Params.prototype = {
Function handleInputChange
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleInputChange = (thresholdKey: keyof Thresholds, value: string) => {
const trimmedValue = value.trim();
if (trimmedValue === "") {
setInputValue("");
setErrorMessage(t("thresholdConfigurator.emptyInputMessage"));
Function applyStyles
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private applyStyles() {
if (!this.div) return;
this.div.innerHTML = "";
Function setSensor
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const setSensor = (
selectedParameter: ParameterType,
sensors: Sensor[],
sessionType: string
) => {
Function handleMarkerClick
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleMarkerClick = (
selectedStreamId: number | null,
id: number | null
) => {
if (currentUserSettings !== UserSettings.SessionListView) {
Function selectFixedStreamShortInfo
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
(fixedStreamData, lastDailyAverage): FixedStreamShortInfo => {
const { value: lastMeasurementValue, date } = lastDailyAverage || {};
const lastMeasurementDateLabel = moment(date).format("MMM D");
const lastUpdate = moment
Function MeasurementComponent
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MeasurementComponent: React.FC = () => {
const { t } = useTranslation();
const extremes = useAppSelector(selectFixedExtremes);
const thresholds = useAppSelector(selectThresholds);
Consider simplifying this complex logical expression. Open
if (
west === undefined ||
east === undefined ||
south === undefined ||
north === undefined ||
Function setParameterParams
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
(selectedParameter: ParameterType, sensors: Sensor[]) => {
const sensorData = setSensor(selectedParameter, sensors, sessionType);
const commonParams = [
{
key: UrlParamsTypes.previousUserSettings,
Method perform
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def perform
alerts = ThresholdAlert.all
Sidekiq.logger.info "[TRSHLD] #{alerts.count} alerts found: #{alerts.inspect}"
alerts.each do |alert|
- 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 StreamMarkers
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const StreamMarkers = ({ sessions, unitSymbol }: Props) => {
const dispatch = useAppDispatch();
const map = useMap();
const markersRef = useRef<Map<string, CustomMarker>>(new Map());
const thresholds = useSelector(selectThresholds);
- 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 ControlPanel
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const ControlPanel: React.FC = () => {
const { mapTypeId, searchParams } = useMapParams();
const navigate = useNavigate();
const isFirstRender = useRef(true);
const { t } = useTranslation();
- 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 SessionsListView
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const SessionsListView: React.FC<SessionsListViewProps> = ({
sessions,
onCellClick,
onCellMouseEnter,
onCellMouseLeave,
- 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 calculateChosenLabel
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
calculateChosenLabel: function () {
var customRange = true;
var i = 0;
for (var range in this.ranges) {
if (this.timePicker) {