mtxr/vscode-sqltools

View on GitHub

Showing 131 of 131 total issues

Formatter has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class Formatter {
  private tokens: Token[] = [];
  private previousReservedWord: Token = { type: null, value: null };
  private indentation: Indentation;
  private inlineBlock: InlineBlock;
Severity: Minor
Found in packages/formatter/src/core/Formatter.ts - About 2 hrs to fix

    Connection has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class Connection {
      private tables: NSDatabase.ITable[] = [];
      private columns: NSDatabase.IColumn[] = [];
      private functions: NSDatabase.IFunction[] = [];
      private connected: boolean = false;
    Severity: Minor
    Found in packages/language-server/connection.ts - About 2 hrs to fix

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

        private _updateSidebar({
          conn,
          tables,
          columns,
          functions
      Severity: Major
      Found in packages/plugins/connection-manager/language-server.ts and 1 other location - About 2 hrs to fix
      packages/plugins/connection-manager/explorer/index.ts on lines 201..230

      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 82.

      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

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

        public setTreeData = ({
          conn,
          tables,
          columns,
          functions
      Severity: Major
      Found in packages/plugins/connection-manager/explorer/index.ts and 1 other location - About 2 hrs to fix
      packages/plugins/connection-manager/language-server.ts on lines 290..304

      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 82.

      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

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

      class SQLToolsLanguageServer implements ILanguageServer<any> {
        private _server: IConnection;
        private _docManager = new TextDocuments();
        private onInitializeHooks: Arg0<IConnection['onInitialize']>[] = [];
        private onInitializedHooks: Arg0<IConnection['onInitialized']>[] = [];
      Severity: Minor
      Found in packages/language-server/server.ts - About 2 hrs to fix

        ConnectionExplorer has 21 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class ConnectionExplorer implements TreeDataProvider<SidebarTreeItem> {
          private treeView: TreeView<TreeItem>;
          private _onDidChangeTreeData: EventEmitter<SidebarTreeItem | undefined> = new EventEmitter();
          private _onConnectionDidChange: EventEmitter<{ conn: IConnection, action: 'added' | 'deleted' | 'changed' }[]> = new EventEmitter();
          public readonly onDidChangeTreeData = this._onDidChangeTreeData.event;
        Severity: Minor
        Found in packages/plugins/connection-manager/explorer/index.ts - About 2 hrs to fix

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

            OracleDB: {
              port: 1521,
              value: DatabaseDriver['OracleDB'],
              icon: getIconPathForDriver(DatabaseDriver['OracleDB']),
              text: 'OracleDB (Node Native)',
          Severity: Major
          Found in packages/ui/screens/Settings/lib/availableDrivers.ts and 1 other location - About 2 hrs to fix
          packages/ui/screens/Settings/lib/availableDrivers.ts on lines 43..55

          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 78.

          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

            DB2: {
              port: 50000,
              value: DatabaseDriver['DB2'],
              icon: getIconPathForDriver(DatabaseDriver['DB2']),
              text: 'DB2 (Node Native)',
          Severity: Major
          Found in packages/ui/screens/Settings/lib/availableDrivers.ts and 1 other location - About 2 hrs to fix
          packages/ui/screens/Settings/lib/availableDrivers.ts on lines 106..119

          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 78.

          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

                case MenuActions.SaveCSVOption:
                  getVscode().postMessage({
                    action: 'call',
                    payload: {
                      command: `${process.env.EXT_NAME}.saveResults`,
          Severity: Major
          Found in packages/ui/screens/Results/ResultsTable.tsx and 1 other location - About 1 hr to fix
          packages/ui/screens/Results/ResultsTable.tsx on lines 224..232

          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 73.

          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

                case MenuActions.SaveJSONOption:
                  getVscode().postMessage({
                    action: 'call',
                    payload: {
                      command: `${process.env.EXT_NAME}.saveResults`,
          Severity: Major
          Found in packages/ui/screens/Results/ResultsTable.tsx and 1 other location - About 1 hr to fix
          packages/ui/screens/Results/ResultsTable.tsx on lines 215..223

          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 73.

          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

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

              if (connIdOrNode) {
                id = connIdOrNode instanceof SidebarConnection ? connIdOrNode.getId() : <string>connIdOrNode;
              } else {
                const conn = await this._pickConnection();
                id = conn ? getConnectionId(conn) : undefined;
          Severity: Major
          Found in packages/plugins/connection-manager/extension.ts and 1 other location - About 1 hr to fix
          packages/plugins/connection-manager/extension.ts on lines 319..324

          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 72.

          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

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

              if (connIdOrNode) {
                id = connIdOrNode instanceof SidebarConnection ? connIdOrNode.getId() : <string>connIdOrNode;
              } else {
                const conn = await this._pickConnection();
                id = conn ? getConnectionId(conn) : undefined;
          Severity: Major
          Found in packages/plugins/connection-manager/extension.ts and 1 other location - About 1 hr to fix
          packages/plugins/connection-manager/extension.ts on lines 292..297

          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 72.

          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

          Function getExtensionConfig has 70 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          function getExtensionConfig(outdir) {
            /** @type webpack.Configuration */
            let config = {
              name: 'ext',
              target: 'node',
          Severity: Major
          Found in packages/extension/webpack.config.js - About 1 hr to fix

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

                  {
                    method === ConnectionMethod.ServerAndPort &&
                    <Text
                      label='Server host*'
                      onChange={server => updateSettings({ server })}
            packages/ui/screens/Settings/Drivers/lib/GenericSettings.tsx on lines 108..116
            packages/ui/screens/Settings/Drivers/lib/GenericSettings.tsx on lines 126..134

            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 69.

            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 3 locations. Consider refactoring.
            Open

                  {
                    method !== ConnectionMethod.ConnectionString &&
                    <Text
                    label='Username*'
                    onChange={username => updateSettings({ username })}
            packages/ui/screens/Settings/Drivers/lib/GenericSettings.tsx on lines 70..78
            packages/ui/screens/Settings/Drivers/lib/GenericSettings.tsx on lines 126..134

            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 69.

            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 3 locations. Consider refactoring.
            Open

                  {
                    method === ConnectionMethod.ConnectionString &&
                    <Text
                    label='Connection String*'
                    onChange={connectString => updateSettings({ connectString })}
            packages/ui/screens/Settings/Drivers/lib/GenericSettings.tsx on lines 70..78
            packages/ui/screens/Settings/Drivers/lib/GenericSettings.tsx on lines 108..116

            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 69.

            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

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

                if (items.length === 0) {
                  const addNew = new TreeItem('No Connections. Click here to add one', TreeItemCollapsibleState.None);
                  addNew.command = {
                    title: 'Add New Connections',
                    command: `${EXT_NAME}.openAddConnectionScreen`,
            Severity: Major
            Found in packages/plugins/connection-manager/explorer/index.ts and 1 other location - About 1 hr to fix
            packages/plugins/connection-manager/explorer/index.ts on lines 107..114

            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 67.

            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

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

                if (items.length === 0) {
                  const addNew = new TreeItem('No Connections. Click here to add one', TreeItemCollapsibleState.None);
                  addNew.command = {
                    title: 'Add New Connections',
                    command: `${EXT_NAME}.openAddConnectionScreen`,
            Severity: Major
            Found in packages/plugins/connection-manager/explorer/index.ts and 1 other location - About 1 hr to fix
            packages/plugins/connection-manager/explorer/index.ts on lines 70..77

            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 67.

            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

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

                    if (req.conn.driver && DependencyManager.runningJobs.includes(req.conn.driver)) {
                      return void this.server.sendNotification(DependeciesAreBeingInstalledNotification, e.data.args);
                    }
            Severity: Major
            Found in packages/plugins/connection-manager/language-server.ts and 1 other location - About 1 hr to fix
            packages/plugins/connection-manager/language-server.ts on lines 173..175

            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 65.

            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

                    case DatabaseDriver.Cassandra:
                      columns.forEach((column) => {
                        this.getOrCreateGroups(connId, driver, column.tree, 1).addItem(new SidebarColumn(this.extension.context, column));
                      });
                      break;
            Severity: Major
            Found in packages/plugins/connection-manager/explorer/index.ts and 1 other location - About 1 hr to fix
            packages/plugins/connection-manager/explorer/index.ts on lines 335..339

            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 65.

            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

            Severity
            Category
            Status
            Source
            Language