Skip to content

Commit 1c48447

Browse files
committed
detekt issues
1 parent 30054d0 commit 1c48447

File tree

9 files changed

+7
-16
lines changed

9 files changed

+7
-16
lines changed

config/detekt/detekt.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build:
66

77
comments:
88
UndocumentedPublicClass:
9-
active: true
9+
active: false #todo: turned off as it's scanning generated code
1010

1111
formatting:
1212
Indentation:

marker/src/main/kotlin/com/sourceplusplus/marker/source/SourceFileMarker.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ open class SourceFileMarker(val psiFile: PsiFile) : SourceMarkProvider {
4848
is KtFile -> true
4949
else -> false
5050
}
51-
} catch (ex: NoClassDefFoundError) {
51+
} catch (ignore: NoClassDefFoundError) {
5252
false
5353
}
5454
}

marker/src/main/kotlin/com/sourceplusplus/marker/source/SourceMarkerUtils.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ object SourceMarkerUtils {
3838
* @since 0.1.0
3939
*/
4040
@JvmStatic
41-
fun getElementAtLine(file: PsiFile, line: Int): PsiElement? {
41+
fun getElementAtLine(file: PsiFile, line: Int): PsiElement {
4242
val document: Document = PsiDocumentManager.getInstance(file.project).getDocument(file)!!
4343
val offset = document.getLineStartOffset(line - 1)
4444
var element: PsiElement = file.viewProvider.findElementAt(offset)!!
@@ -503,7 +503,7 @@ object SourceMarkerUtils {
503503
} else {
504504
qualifiedType.qualifiedName
505505
}
506-
for (i in 0 until arrayDimensions) {
506+
repeat(arrayDimensions) {
507507
methodParams += "[]"
508508
}
509509
} else {

marker/src/main/kotlin/com/sourceplusplus/marker/source/mark/api/ClassSourceMark.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class ClassSourceMark(
3939
override val valid: Boolean; get() {
4040
return try {
4141
psiClass.isPsiValid && artifactQualifiedName == psiClass.qualifiedName!!
42-
} catch (ex: PsiInvalidElementAccessException) {
42+
} catch (ignore: PsiInvalidElementAccessException) {
4343
false
4444
}
4545
}

marker/src/main/kotlin/com/sourceplusplus/marker/source/mark/api/ExpressionSourceMark.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class ExpressionSourceMark(
3939
override val valid: Boolean; get() {
4040
return try {
4141
psiExpression.isPsiValid && artifactQualifiedName == SourceMarkerUtils.getFullyQualifiedName(psiExpression)
42-
} catch (ex: PsiInvalidElementAccessException) {
42+
} catch (ignore: PsiInvalidElementAccessException) {
4343
false
4444
}
4545
}

marker/src/main/kotlin/com/sourceplusplus/marker/source/mark/api/MethodSourceMark.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class MethodSourceMark(
3939
override val valid: Boolean; get() {
4040
return try {
4141
psiMethod.isPsiValid && artifactQualifiedName == SourceMarkerUtils.getFullyQualifiedName(psiMethod)
42-
} catch (ex: PsiInvalidElementAccessException) {
42+
} catch (ignore: PsiInvalidElementAccessException) {
4343
false
4444
}
4545
}

marker/src/main/kotlin/com/sourceplusplus/marker/source/mark/api/component/jcef/SourceMarkJcefComponent.kt

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class SourceMarkJcefComponent(
2323
) : SourceMarkComponent {
2424

2525
companion object {
26-
private val log = LoggerFactory.getLogger(SourceMarkJcefComponent::class.java)
2726
private val client: JBCefClient by lazy { JBCefApp.getInstance().createClient() }
2827

2928
init {

marker/src/main/kotlin/com/sourceplusplus/marker/source/mark/gutter/GutterMark.kt

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import org.slf4j.LoggerFactory
1212
*/
1313
interface GutterMark : SourceMark {
1414

15-
companion object {
16-
private val log = LoggerFactory.getLogger(GutterMark::class.java)
17-
}
18-
1915
override val type: SourceMark.Type
2016
get() = SourceMark.Type.GUTTER
2117
override val configuration: GutterMarkConfiguration

marker/src/main/kotlin/com/sourceplusplus/marker/source/mark/inlay/InlayMark.kt

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import org.slf4j.LoggerFactory
1212
*/
1313
interface InlayMark : SourceMark {
1414

15-
companion object {
16-
private val log = LoggerFactory.getLogger(InlayMark::class.java)
17-
}
18-
1915
override val type: SourceMark.Type
2016
get() = SourceMark.Type.INLAY
2117
override val configuration: InlayMarkConfiguration

0 commit comments

Comments
 (0)