Showing 1,088 of 2,665 total issues
File charts.go
has 1078 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package vernemq
import (
Function legendUpdateDOM
has 387 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.legendUpdateDOM = function () {
let needed = false, dim, keys, len;
// check that the legend DOM is up to date for the downloaded dimensions
if (typeof this.element_legend_childs.series !== 'object' || this.element_legend_childs.series === null) {
Function legendUpdateDOM
has 387 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.legendUpdateDOM = function () {
let needed = false, dim, keys, len;
// check that the legend DOM is up to date for the downloaded dimensions
if (typeof this.element_legend_childs.series !== 'object' || this.element_legend_childs.series === null) {
File dygraph.js
has 762 lines of code (exceeds 250 allowed). Consider refactoring. Open
// dygraph
// Codacy declarations
/* global smoothPlotter */
/* global Dygraph */
File charts.go
has 994 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package mongo
import (
File gen_integrations.py
has 727 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
import json
import os
import re
Function analyze_scalar
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
def analyze_scalar(self, scalar):
# Empty scalar is a special case.
if not scalar:
return ScalarAnalysis(scalar=scalar, empty=True, multiline=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
File charts.go
has 938 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package clickhouse
import (
File charts.go
has 907 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package nginxplus
import (
File six.py
has 654 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# SPDX-License-Identifier: MIT
Function runOnceOnDashboardWithjQuery
has 281 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runOnceOnDashboardWithjQuery() {
if (runOnceOnDashboardLastRun !== 0) {
scrollDashboardTo();
// restore the scrollspy at the proper position
File connectionpool.py
has 622 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
from __future__ import absolute_import
import errno
import logging
import sys
Function get
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
get: function (uuid, min, max, units, desired_units, common_units_name, switch_units_callback) {
// validate the parameters
if (typeof units === 'undefined') {
units = 'undefined';
}
- 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
Scanner
has 71 functions (exceeds 20 allowed). Consider refactoring. Open
class Scanner:
def __init__(self):
"""Initialize the scanner."""
# It is assumed that Scanner and Reader will have a common descendant.
Method NginxPlus.updateCharts
has a Cognitive Complexity of 81 (exceeds 20 allowed). Consider refactoring. Open
func (n *NginxPlus) updateCharts() {
const notSeenLimit = 3
for key, v := range n.cache.httpCaches {
if v.updated && !v.hasCharts {
- 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 Postgres.collectMetrics
has 274 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *Postgres) collectMetrics(mx map[string]int64) {
mx["server_connections_used"] = p.mx.connUsed
if p.mx.maxConnections > 0 {
mx["server_connections_available"] = p.mx.maxConnections - p.mx.connUsed
mx["server_connections_utilization"] = calcPercentage(p.mx.connUsed, p.mx.maxConnections)
File constructor.py
has 581 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',
'ConstructorError']
File charts.go
has 823 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package envoy
import (
Method Postgres.collectMetrics
has a Cognitive Complexity of 77 (exceeds 20 allowed). Consider refactoring. Open
func (p *Postgres) collectMetrics(mx map[string]int64) {
mx["server_connections_used"] = p.mx.connUsed
if p.mx.maxConnections > 0 {
mx["server_connections_available"] = p.mx.maxConnections - p.mx.connUsed
mx["server_connections_utilization"] = calcPercentage(p.mx.connUsed, p.mx.maxConnections)
- 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
File charts.go
has 814 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package weblog
import (