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/settings/MiscSettings.java on lines 1..79

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

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

/*
 *     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/settings/TimeoutSettings.java on lines 1..84

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

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

    Array(typ) ++ fields.values.map {
      case t: JTextField => t.getText().trim
      case tb: TextFieldWithBrowseButton => tb.getText.trim
      case b: JComboBox[String@unchecked] => b.getSelectedItem.asInstanceOf[String]
      case u: JComponent => LOG.error("Unknown JComponent : " + u)
src/main/scala/com/github/gtache/lsp/settings/gui/ServersGUIRow.scala on lines 44..50

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

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

    fields.get(label).fold("") {
      case t: JTextField => t.getText().trim
      case tb: TextFieldWithBrowseButton => tb.getText.trim
      case b: JComboBox[String@unchecked] => b.getSelectedItem.asInstanceOf[String]
      case u: JComponent => LOG.error("Unknown JComponent : " + u)
src/main/scala/com/github/gtache/lsp/settings/gui/ServersGUIRow.scala on lines 57..63

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

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

    EditorEventManager.forEditor(editor) match {
      case Some(manager) =>
        val renameTo = Messages.showInputDialog(editor.getProject, "Enter new name: ", "Rename", Messages.getQuestionIcon, "", new NonEmptyInputValidator())
        if (renameTo != null && renameTo != "") manager.rename(renameTo)
      case None =>
src/main/scala/com/github/gtache/lsp/actions/LSPRefactoringAction.scala on lines 32..37

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

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

    EditorEventManager.forEditor(editor) match {
      case Some(manager) =>
        val renameTo = Messages.showInputDialog(e.getProject, "Enter new name: ", "Rename", Messages.getQuestionIcon, "", new NonEmptyInputValidator())
        if (renameTo != null && renameTo != "") manager.rename(renameTo)
      case None =>
src/main/scala/com/github/gtache/lsp/contributors/rename/LSPRenameHandler.scala on lines 81..86

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

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

      try {
        val definition = request.get(DEFINITION_TIMEOUT, TimeUnit.MILLISECONDS)
        wrapper.notifySuccess(Timeouts.DEFINITION)
        if (definition != null && !definition.isEmpty()) {
          definition.get(0)
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 354..367
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 725..745

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

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

      try {
        val references = future.get(REFERENCES_TIMEOUT, TimeUnit.MILLISECONDS)
        wrapper.notifySuccess(Timeouts.REFERENCES)
        if (references != null) {
          references.asScala.collect {
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 354..367
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1167..1184

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

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

      try {
        val res = future.get(CODEACTION_TIMEOUT, TimeUnit.MILLISECONDS).asScala
        wrapper.notifySuccess(Timeouts.CODEACTION)
        res
      } catch {
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 725..745
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1167..1184

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

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

      try {
        val hover = request.get(HOVER_TIMEOUT, TimeUnit.MILLISECONDS)
        wrapper.notifySuccess(Timeouts.HOVER)
        if (hover != null) {
          val string = HoverHandler.getHoverString(hover)
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 210..237
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 258..269
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 502..516
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 680..696
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 854..869
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1382..1405

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

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

          try {
            val references = future.get(REFERENCES_TIMEOUT, TimeUnit.MILLISECONDS)
            wrapper.notifySuccess(Timeouts.REFERENCES)
            if (references != null) {
              invokeLater(() => {
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 210..237
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 258..269
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 502..516
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 680..696
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1087..1112
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1382..1405

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

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

          try {
            val edits = future.get(FORMATTING_TIMEOUT, TimeUnit.MILLISECONDS)
            wrapper.notifySuccess(Timeouts.FORMATTING)
            if (edits != null) invokeLater(() => applyEdit(edits = edits.asScala, name = "On type formatting"))
          } catch {
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 210..237
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 502..516
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 680..696
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 854..869
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1087..1112
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1382..1405

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

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

          try {
            val signature = future.get(SIGNATURE_TIMEOUT, TimeUnit.MILLISECONDS)
            wrapper.notifySuccess(Timeouts.SIGNATURE)
            if (signature != null) {
              val signatures = signature.getSignatures
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 258..269
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 502..516
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 680..696
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 854..869
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1087..1112
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1382..1405

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

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

                try {
                  val resp = request.get(DOC_HIGHLIGHT_TIMEOUT, TimeUnit.MILLISECONDS)
                  wrapper.notifySuccess(Timeouts.DOC_HIGHLIGHT)
                  if (resp != null) {
                    invokeLater(() => resp.asScala.foreach(dh => {
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 210..237
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 258..269
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 502..516
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 680..696
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 854..869
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1087..1112

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

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

            try {
              val ret = f.get(EXECUTE_COMMAND_TIMEOUT, TimeUnit.MILLISECONDS)
              wrapper.notifySuccess(Timeouts.EXECUTE_COMMAND)
              ret match {
                case e: WorkspaceEdit => WorkspaceEditHandler.applyEdit(e, name = "Execute command")
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 210..237
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 258..269
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 680..696
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 854..869
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1087..1112
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1382..1405

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

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

            try {
              val edits = future.get(WILLSAVE_TIMEOUT, TimeUnit.MILLISECONDS)
              wrapper.notifySuccess(Timeouts.WILLSAVE)
              if (edits != null) {
                invokeLater(() => applyEdit(edits = edits.asScala, name = "WaitUntil edits"))
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 210..237
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 258..269
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 502..516
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 854..869
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1087..1112
src/main/scala/com/github/gtache/lsp/editor/EditorEventManager.scala on lines 1382..1405

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

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 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 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/EditorMouseMotionListenerImpl.scala on lines 1..34

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

Severity
Category
Status
Source
Language