GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Data Flow code is outdated? · Issue #2124 · pmd/pmd

Data Flow code is outdated? #2124

New issue
Copy link
New issue
Copy link
Closed
Closed
Data Flow code is outdated?#2124
Copy link
Labels
in:data-flowAffects the data flow analysis codewas:wontfix

Description

@michaelhoefer
michaelhoefer
opened on Nov 23, 2019
Issue body actions

[java][apex]

Greetings all. Issue here is it is unclear from reading the code and open issues, it is not clear why part of the data flow code is deprecated. I've seen statements in other issues to the effect that the current data flow code framework is "outdated". Can someone share more about that? There are deprecations with no alternatives.

I'm looking at the feasibility of DFA in PMD, especially for Apex and JS, and for obvious reasons do not want to travel down an abandoned road. Would appreciate any insight you can provide into what is wrong with the current impl and what the plans are to replace it.

thanks!

Reacted by Robert Sösemann

Activity

  1. adangel
    added
    in:data-flowAffects the data flow analysis code
    on Nov 24, 2019
  2. adangel commented on Nov 24, 2019

    @adangel
    adangel
    on Nov 24, 2019
    Member
    More actions

    Hi,

    the only language, that has some kind of "data flow support" is Java. And that implementation is now more than 10 years old and has not been updated (e.g. it doesn't support for-each loops).

    It is also very limited, e.g. it is more a simple control flow. It only looks at one method. It has some endless loops in the implementation. It's also questionable, whether the current abstractions we have are useful if you want to implement DFA in other languages.

    Most of the deprecations you see on master are in combination with "InternalApi" (see also https://pmd.github.io/latest/pmd_next_major_development.html#internal-packages-and-internalapi-annotation) . We try to reshape the API in PMD 7 and at the moment, it's not clear yet, how the API for a language to implement DFA would look like.

    It's pretty sure, that DFA would be implemented via a separate AST processing stage (see also #1426). But API design is needed e.g. to define how the results of DFA (e.g. flow graphs) are made available for consumption in rules (the only rule that's using DFA on master is DataFlowAnomalyAnalysisRule).

    Any input, thought, requirements, etc. for shaping the data flow API are very much welcome!

    Reacted by Robert Sösemann
  3. linusjf commented on Dec 1, 2019

    @linusjf
    linusjf
    on Dec 1, 2019
    More actions

    Why only look at this rule? Why not the law of Demeter as well? I, for one, don't use the rule since it flags just so many errors in my code.

    But I think it could be useful if refined further.

    https://stackoverflow.com/a/59124629/3924108

    Another problem appears to be streams or lambdas:
    https://stackoverflow.com/q/53777038/3924108

    Another issue to be raised for this?

    Another side note:

    Do we need rules to enforce refactoring such as split a method that has a boolean parameter into two so that each method does just one thing.

    https://martinfowler.com/bliki/FlagArgument.html

  4. adangel
    added
    was:wontfix
    on Aug 2, 2020
  5. adangel commented on Aug 2, 2020

    @adangel
    adangel
    on Aug 2, 2020
    Member
    More actions

    The rule DataflowAnomalyAnalysis has been deprecated in favour of UnusedAssignment, which is available with PMD 6.26.0.

    Therefore this issue wont be fixed.

    See also #2647.

  6. adangel
    closed this as completedon Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in:data-flowAffects the data flow analysis codewas:wontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.