This page is not yet available in Spanish. We are working on its translation. If you have any questions or feedback about our current translation project, feel free to reach out to us!
Metadata
ID:kotlin-code-style/max-line-len
Language: Kotlin
Severity: Notice
Category: Code Style
Description
This rule ensures that no line in your Kotlin code exceeds a certain maximum length, set to 140 characters by default. Exceeding this limit can lead to code that is difficult to read and understand, especially when working with complex codebases or reviewing code changes. It can also cause issues with version control systems that have difficulty handling long lines.
The rule take the argument max-line-length to adapt its behavior with your coding style and guidelines.
Non-Compliant Code Examples
valfooooooooooooooo="fooooooooooooooooooooo"valfoo="foo"+"ooooooooooooooooooooooooooo"valfoooooooooooooo="foooooooooooooooooooo"// some comment
valbad="fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"valfoooooooooooooo="foooooooooooooooooooo"// some comment
foo(bar,baz,bli,blo,foooooooooooooooooooo,foooooooooooooooooooo2,foooooooooooooooooooo3,foooooooooooooooooooo43)
valfooooooooooooooo="fooooooooooooooooooooo"valfoo="foo"+"ooooooooooooooooooooooooooo"valfoooooooooooooo="foooooooooooooooooooo"// some comment
foo(bar)
Integraciones sin problemas. Prueba Datadog Code Security
Datadog Code Security
Prueba esta regla y analiza tu código con Datadog Code Security
Cómo usar esta regla
1
2
rulesets:- kotlin-code-style # Rules to enforce Kotlin code style.
Crea un static-analysis.datadog.yml con el contenido anterior en la raíz de tu repositorio
Utiliza nuestros complementos del IDE gratuitos o añade análisis de Code Security a tus pipelines de CI.