iccicci/sedentary-pg

View on GitHub

Showing 12 of 12 total issues

File local.ts has 578 lines of code (exceeds 500 allowed). Consider refactoring.
Open

import { DatabaseError, Pool } from "pg";

if(! process.env.SPG) throw "Missing SPG!";

const v10 = process.version.startsWith("v10");
Severity: Major
Found in test/local.ts - About 3 hrs to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      describe("NUMBER", function() {
        helper(expected.types_number, async db => {
          db.model("test1", {
            a: db.NUMBER,
            b: db.NUMBER,
    Severity: Major
    Found in test/03data_types.test.ts and 1 other location - About 3 hrs to fix
    test/03data_types.test.ts on lines 85..105

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 167.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      describe("BOOLEAN", function() {
        helper(expected.types_boolean, async db => {
          db.model("test1", {
            a: db.BOOLEAN,
            b: db.BOOLEAN,
    Severity: Major
    Found in test/03data_types.test.ts and 1 other location - About 3 hrs to fix
    test/03data_types.test.ts on lines 63..83

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 167.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    PGDB has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class PGDB extends DB<TransactionPG> {
      private _client: PoolClient = {} as PoolClient;
      private indexes: string[] = [];
      private oidLoad: Record<number, (ids: Natural[]) => Promise<EntryBase[]>> = {};
      private pool: Pool;
    Severity: Minor
    Found in pgdb.ts - About 2 hrs to fix

      Avoid deeply nested control flow statements.
      Open

                  if(adsrc) dropDefault();
      Severity: Major
      Found in pgdb.ts - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if(this.sync) await this._client.query(statement);
        Severity: Major
        Found in pgdb.ts - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                  } else if(! adsrc || this.defaultNeq(adsrc, defaultValue)) await setDefault(attnotnull);
          Severity: Major
          Found in pgdb.ts - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      if(adsrc) dropDefault();
            Severity: Major
            Found in pgdb.ts - About 45 mins to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    helper(expected.types_datetime_changes, true, async db => {
                      db.model("test1", {
                        a: db.DATETIME,
                        b: db.VARCHAR,
                        c: db.DATETIME,
              Severity: Minor
              Found in test/03data_types.test.ts and 1 other location - About 40 mins to fix
              test/03data_types.test.ts on lines 36..46

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 104.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  helper(expected.types_datetime, async db => {
                    db.model("test1", {
                      a: db.DATETIME,
                      b: db.DATETIME,
                      c: db.VARCHAR,
              Severity: Minor
              Found in test/03data_types.test.ts and 1 other location - About 40 mins to fix
              test/03data_types.test.ts on lines 49..59

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 104.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Parsing error: parser.parse is not a function
              Open

              // eslint-disable-next-line @typescript-eslint/no-var-requires
              Severity: Minor
              Found in testSequencer.js by eslint

              For more information visit Source: http://eslint.org/docs/rules/

              Parsing error: parser.parse is not a function
              Open

              /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
              Severity: Minor
              Found in jest.config.js by eslint

              For more information visit Source: http://eslint.org/docs/rules/

              Severity
              Category
              Status
              Source
              Language