excessive-visibility misses test calls on a literal, a void or a local bound to another expression

Abierto
#1,870 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java, xml
Área
tooling

Línea de trabajo

Read src/main/resources/org/eolang/lints/design/excessive-visibility.xsl and follow how $used matches test-call bases, comparing folded calls with postfix calls. Check existing lint tests for these receiver forms, then add coverage for literal, void, and locally bound receivers. Done means calls whose attribute name is the last segment or the segment before a further dispatch count as references, and the false reports are gone.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

excessive-visibility in src/main/resources/org/eolang/lints/design/excessive-visibility.xsl accepts a test that chains a dotted call onto any expression, such as (phrase "x").multi-words, whatever the receiver is. The parser gives that a .multi-words base, and $used matches it by the attribute name alone. When the receiver is a plain name instead of an expression, the parser folds the call into the base, and the lint then wants the receiver to be the object itself, or a local bound to the object's @loc (#1799). Calls on any other receiver are missed, so these reports from eo-runtime are false, because each method has a test:

# bool.eo, reported: The attribute "or" is public, but no unit test refers to it
true.or false ++> can-disjoin-true-with-false
# chunk.eo, reported for "put" and "get"
eq. ++> can-put-and-get
  malloc.of
    8
    seq * > [c]
      c.put 42
      c.get
  42.as-bytes
# directory.eo, reported for "retried"
mktemp.tmpfile.deleted.as-path.as-dir.made > parent
...
parent.retried
  parent.path
  42

The bases are Φ.true.or, ξ.v🌵c.put, ξ.v🌵c.get and ξ.parent.retried. true decorates bool, c is a void, and parent is bound to a dispatch chain, so none of them is Φ.bool, Φ.chunk or Φ.directory by name. file.path is reported the same way through ξ.temp.path.

The fix is to treat a folded call the way the lint already treats the postfix one. A base in a test whose last segment, or the segment before a further dispatch, is the attribute name should count as a reference whatever comes before it. The lint is already that lenient with (expr).name, so this only removes the difference between two spellings of the same call.

Lenguaje dominante
Java
Estrellas
14
Forks
43
Merge medio
1 d 20 h
PR fusionados (30 d)
166

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de objectionary/lints

Todos los issues de objectionary/lints

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.