intellij-lsp/intellij-lsp-plugin

View on GitHub
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala

Summary

Maintainability
D
2 days
Test Coverage
F
0%

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

  override def completionItemResolve(unresolved: CompletionItem): CompletableFuture[CompletionItem] =
    if (checkStatus) try {
      if (serverCapabilities.getCompletionProvider != null && serverCapabilities.getCompletionProvider.getResolveProvider) textDocumentService.resolveCompletionItem(unresolved) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 276..282
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 292..298

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

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 resolveCodeLens(unresolved: CodeLens): CompletableFuture[CodeLens] =
    if (checkStatus) try {
      if (serverCapabilities.getCodeLensProvider != null && serverCapabilities.getCodeLensProvider.isResolveProvider) textDocumentService.resolveCodeLens(unresolved) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 173..179
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 292..298

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

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 documentLinkResolve(unresolved: DocumentLink): CompletableFuture[DocumentLink] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentLinkProvider != null && serverCapabilities.getDocumentLinkProvider.getResolveProvider) textDocumentService.documentLinkResolve(unresolved) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 173..179
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 276..282

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

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

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

  override def signatureHelp(params: TextDocumentPositionParams): CompletableFuture[SignatureHelp] =
    if (checkStatus) try {
      if (serverCapabilities.getSignatureHelpProvider != null) textDocumentService.signatureHelp(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 113..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 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 didOpen(params: DidOpenTextDocumentParams): Unit =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getOpenClose) textDocumentService.didOpen(params)
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 136..141
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 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 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

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 hover(params: TextDocumentPositionParams): CompletableFuture[Hover] =
    if (checkStatus) try {
      if (serverCapabilities.getHoverProvider) textDocumentService.hover(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 300..306

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

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 rename(params: RenameParams): CompletableFuture[WorkspaceEdit] =
    if (checkStatus) try {
      if (serverCapabilities.getRenameProvider) textDocumentService.rename(params) else null
    } catch {
      case e: Exception => crashed(e)
src/main/scala/com/github/gtache/lsp/client/languageserver/requestmanager/SimpleRequestManager.scala on lines 181..187

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

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

Avoid using null
Open

      if (serverCapabilities.getRenameProvider) textDocumentService.rename(params) else null

If block needs braces
Open

    if (checkStatus) try {

If block needs braces
Open

    if (checkStatus) try {

If block needs braces
Open

    if (checkStatus) try {

Avoid using null
Open

      if (serverCapabilities.getWorkspaceSymbolProvider) workspaceService.symbol(params) else null

Avoid using null
Open

      if (serverCapabilities.getDocumentHighlightProvider) textDocumentService.documentHighlight(params) else null

If block needs braces
Open

    if (checkStatus) try {

Number of methods in class exceeds 30
Open

class SimpleRequestManager(wrapper: LanguageServerWrapper, server: LanguageServer, client: LanguageClient, serverCapabilities: ServerCapabilities) extends RequestManager {

Avoid using null
Open

      if (serverCapabilities.getCodeActionProvider) textDocumentService.codeAction(params) else null

If block needs braces
Open

    if (checkStatus) try {

If block needs braces
Open

    if (checkStatus) try {

File line length exceeds 160 characters
Open

      if (serverCapabilities.getCodeLensProvider != null && serverCapabilities.getCodeLensProvider.isResolveProvider) textDocumentService.resolveCodeLens(unresolved) else null

Avoid using null
Open

      if (serverCapabilities.getDocumentFormattingProvider) textDocumentService.formatting(params) else null

Avoid using null
Open

      if (serverCapabilities.getDocumentRangeFormattingProvider) textDocumentService.rangeFormatting(params) else null

If block needs braces
Open

    if (checkStatus) try {

File line length exceeds 160 characters
Open

  override def showMessageRequest(showMessageRequestParams: ShowMessageRequestParams): CompletableFuture[MessageActionItem] = client.showMessageRequest(showMessageRequestParams)

Avoid using null
Open

      if (serverCapabilities.getExecuteCommandProvider != null) workspaceService.executeCommand(params) else null

Avoid using null
Open

      if (textDocumentOptions == null || textDocumentOptions.getWillSaveWaitUntil) textDocumentService.willSaveWaitUntil(params) else null

Avoid using null
Open

      if (serverCapabilities.getCodeLensProvider != null && serverCapabilities.getCodeLensProvider.isResolveProvider) textDocumentService.resolveCodeLens(unresolved) else null

Avoid using null
Open

      if (serverCapabilities.getDocumentLinkProvider != null && serverCapabilities.getDocumentLinkProvider.getResolveProvider) textDocumentService.documentLinkResolve(unresolved) else null

If block needs braces
Open

    if (checkStatus) try {

If block needs braces
Open

    if (checkStatus) try {

File line length exceeds 160 characters
Open

class SimpleRequestManager(wrapper: LanguageServerWrapper, server: LanguageServer, client: LanguageClient, serverCapabilities: ServerCapabilities) extends RequestManager {

Avoid using null
Open

      if (serverCapabilities.getReferencesProvider) textDocumentService.references(params) else null

Avoid wildcard imports
Open

import org.eclipse.lsp4j._

Avoid using null
Open

      if (serverCapabilities.getDefinitionProvider) textDocumentService.definition(params) else null

If block needs braces
Open

    if (checkStatus) try {

Avoid using null
Open

  private val textDocumentOptions = if (serverCapabilities.getTextDocumentSync.isRight) serverCapabilities.getTextDocumentSync.getRight else null

Avoid using null
Open

      if (serverCapabilities.getCompletionProvider != null && serverCapabilities.getCompletionProvider.getResolveProvider) textDocumentService.resolveCompletionItem(unresolved) else null

Avoid using null
Open

      if (serverCapabilities.getHoverProvider) textDocumentService.hover(params) else null

Avoid using null
Open

      if (serverCapabilities.getDocumentLinkProvider != null) textDocumentService.documentLink(params) else null

If block needs braces
Open

    if (checkStatus) try {

If block needs braces
Open

    if (checkStatus) try {

Avoid using null
Open

      if (serverCapabilities.getCompletionProvider != null) textDocumentService.completion(params) else null

If block needs braces
Open

    if (checkStatus) try {

If block needs braces
Open

    if (checkStatus) try {

Avoid using null
Open

      if (serverCapabilities.getSignatureHelpProvider != null) textDocumentService.signatureHelp(params) else null

Avoid using null
Open

      if (serverCapabilities.getCodeLensProvider != null) textDocumentService.codeLens(params) else null

Avoid using null
Open

      if (serverCapabilities.getDocumentSymbolProvider) textDocumentService.documentSymbol(params) else null

If block needs braces
Open

    if (checkStatus) try {

File line length exceeds 160 characters
Open

      if (serverCapabilities.getCompletionProvider != null && serverCapabilities.getCompletionProvider.getResolveProvider) textDocumentService.resolveCompletionItem(unresolved) else null

If block needs braces
Open

    if (checkStatus) try {

If block needs braces
Open

    if (checkStatus) try {

If block needs braces
Open

    if (checkStatus) try {

Avoid using null
Open

      if (serverCapabilities.getDocumentOnTypeFormattingProvider != null) textDocumentService.onTypeFormatting(params) else null

If block needs braces
Open

    if (checkStatus) try {

If block needs braces
Open

    if (checkStatus) try {

File line length exceeds 160 characters
Open

      if (serverCapabilities.getDocumentLinkProvider != null && serverCapabilities.getDocumentLinkProvider.getResolveProvider) textDocumentService.documentLinkResolve(unresolved) else null

If block needs braces
Open

    if (checkStatus) try {

If block needs braces
Open

    if (checkStatus) try {

There are no issues that match your filters.

Category
Status