intellij-lsp/intellij-lsp-plugin

View on GitHub

Showing 52 of 774 total issues

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

/**
 *     Copyright 2017-2018 Guillaume Tâche
 *
 *     Licensed under the Apache License, Version 2.0 (the "License");
 *     you may not use this file except in compliance with the License.
src/main/scala/com/github/gtache/lsp/editor/listeners/DocumentListenerImpl.scala on lines 1..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 83.

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

  override def onTypeFormatting(params: DocumentOnTypeFormattingParams): CompletableFuture[java.util.List[_ <: TextEdit]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentOnTypeFormattingProvider != null) textDocumentService.onTypeFormatting(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 268..274

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

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

  override def codeLens(params: CodeLensParams): CompletableFuture[java.util.List[_ <: CodeLens]] =
    if (checkStatus) try {
      if (serverCapabilities.getCodeLensProvider != null) textDocumentService.codeLens(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 244..250

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

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

  override def didSave(params: DidSaveTextDocumentParams): Unit =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getSave != null) textDocumentService.didSave(params)
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 129..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 76.

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

  override def didChange(params: DidChangeTextDocumentParams): Unit =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getChange != null) textDocumentService.didChange(params)
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 151..156

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

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

  override def codeAction(params: CodeActionParams): CompletableFuture[java.util.List[_ <: Command]] =
    if (checkStatus) try {
      if (serverCapabilities.getCodeActionProvider) textDocumentService.codeAction(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 105..111
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 204..210
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 212..218
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 220..226
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 228..234
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 236..242
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 252..258

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

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

  override def documentSymbol(params: DocumentSymbolParams): CompletableFuture[java.util.List[_ <: SymbolInformation]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentSymbolProvider) textDocumentService.documentSymbol(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 105..111
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 204..210
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 212..218
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 228..234
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 236..242
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 252..258
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 260..266

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

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

  override def rangeFormatting(params: DocumentRangeFormattingParams): CompletableFuture[java.util.List[_ <: TextEdit]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentRangeFormattingProvider) textDocumentService.rangeFormatting(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 105..111
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 204..210
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 212..218
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 220..226
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 228..234
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 252..258
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 260..266

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

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

  override def references(params: ReferenceParams): CompletableFuture[java.util.List[_ <: Location]] =
    if (checkStatus) try {
      if (serverCapabilities.getReferencesProvider) textDocumentService.references(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 105..111
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 212..218
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 220..226
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 228..234
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 236..242
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 252..258
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 260..266

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

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

  override def definition(params: TextDocumentPositionParams): CompletableFuture[java.util.List[_ <: Location]] =
    if (checkStatus) try {
      if (serverCapabilities.getDefinitionProvider) textDocumentService.definition(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 105..111
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 204..210
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 212..218
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 220..226
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 228..234
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 236..242
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 260..266

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

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

  override def symbol(params: WorkspaceSymbolParams): CompletableFuture[java.util.List[_ <: SymbolInformation]] =
    if (checkStatus) try {
      if (serverCapabilities.getWorkspaceSymbolProvider) workspaceService.symbol(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 204..210
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 212..218
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 220..226
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 228..234
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 236..242
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 252..258
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 260..266

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

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

  override def documentHighlight(params: TextDocumentPositionParams): CompletableFuture[java.util.List[_ <: DocumentHighlight]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentHighlightProvider) textDocumentService.documentHighlight(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 105..111
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 204..210
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 220..226
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 228..234
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 236..242
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 252..258
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 260..266

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

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

  override def formatting(params: DocumentFormattingParams): CompletableFuture[java.util.List[_ <: TextEdit]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentFormattingProvider) textDocumentService.formatting(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 105..111
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 204..210
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 212..218
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 220..226
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 236..242
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 252..258
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 260..266

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

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

          EditorEventManager.forEditor(editor) match {
            case Some(m) => ApplicationUtils.invokeLater(() => elements = m.references(editor.getCaretModel.getCurrentCaret.getOffset, getOriginalElement = true)._1)
            case None =>
          }
src/main/scala/com/github/gtache/lsp/contributors/LSPFindUsagesHandlerFactory.scala on lines 37..40

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

          EditorEventManager.forEditor(editor) match {
            case Some(m) => ApplicationUtils.invokeLater(() => elements = m.references(editor.getCaretModel.getCurrentCaret.getOffset, getOriginalElement = true)._1)
            case None =>
          }
src/main/scala/com/github/gtache/lsp/contributors/LSPFindUsagesHandlerFactory.scala on lines 43..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 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

        panel.add(newRowButton, new GridConstraints(0, 15, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
src/main/scala/com/github/gtache/lsp/settings/gui/ServersGUI.java on lines 223..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 50.

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

            panel.add(removeRowButton, new GridConstraints(0, 16, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
src/main/scala/com/github/gtache/lsp/settings/gui/ServersGUI.java on lines 218..218

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

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

  override def didClose(params: DidCloseTextDocumentParams): Unit =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getOpenClose) textDocumentService.didClose(params)
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 122..127
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 136..141

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

  override def willSave(params: WillSaveTextDocumentParams): Unit =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getWillSave) textDocumentService.willSave(params)
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 122..127
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 158..163

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

  override def executeCommand(params: ExecuteCommandParams): CompletableFuture[AnyRef] =
    if (checkStatus) try {
      if (serverCapabilities.getExecuteCommandProvider != null) workspaceService.executeCommand(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 196..202

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

Severity
Category
Status
Source
Language