netdata/netdata

View on GitHub
src/go/collectors/go.d.plugin/modules/postgres/queries.go

Summary

Maintainability
C
1 day
Test Coverage

File queries.go has 693 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// SPDX-License-Identifier: GPL-3.0-or-later

package postgres

func queryServerVersion() string {
Severity: Minor
Found in src/go/collectors/go.d.plugin/modules/postgres/queries.go - About 6 hrs to fix

    Function queryReplicationSlotFiles has 104 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func queryReplicationSlotFiles(version int) string {
        if version < pgVersion11 {
            return `
    WITH wal_size AS (
      SELECT
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/postgres/queries.go - About 3 hrs to fix

      Function queryBloat has 72 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func queryBloat() string {
          return `
      SELECT
        current_database() AS db, schemaname, tablename, reltuples::bigint AS tups, relpages::bigint AS pages, otta,
        ROUND(CASE WHEN otta=0 OR sml.relpages=0 OR sml.relpages=otta THEN 0.0 ELSE sml.relpages/otta::numeric END,1) AS tbloat,
      Severity: Minor
      Found in src/go/collectors/go.d.plugin/modules/postgres/queries.go - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status