Giter Site home page Giter Site logo

coupling-mapping's People

Contributors

greg4cr avatar

Watchers

 avatar  avatar  avatar

coupling-mapping's Issues

Investigate strange results

Some that stand out:
newStringBuilder.append.append.append.append.append.append.append'.toString
(the character mark)

newCompareToBuilder.append,other.getLeft.append,other.getMiddle.append,other.getRight.toComparison
(comma-sep list, think a "new" might be getting merged in)

Look over next week.

Parentheses not handled correctly

For example:
(new BigDecimal(Double.toString(x)).setScale(scale,roundingMethod)).doubleValue

There is a "." inside the parentheses (the .setScale). Currently, expressions assume that segments (between ".") are independent (unless they are arguments). Need to adjust how these expressions are handled.

Ternary expressions need filtered

Ternary expressions with couplings are placed in the coupling list. Everything before the "." is considered the be the variable name:

Coupled to non-project class: value==1?iSingularText:iPluralText.length

These get caught and removed, and the actual coupling ('iPluralText.length') is caught, so there is no effect on the end results. Still, these should be filtered out to prevent confusion.

Anonymous classes should be able to use variables from the outer class

See:

@Override
        public Iterator<Entry> iterator() {
            final Iterator<Entry> i = v.iterator();
            return new Iterator<Entry>() {
                /** The current entry. */
                private final UnmodifiableEntry e = new UnmodifiableEntry();

                /** {@inheritDoc} */
                public boolean hasNext() {
                    return i.hasNext();
                }

                /** {@inheritDoc} */
                public Entry next() {
                    e.setIndex(i.next().getIndex());
                    return e;
                }

                /**
                 * {@inheritDoc}
                 *
                 * @throws MathUnsupportedOperationException in all
                 * circumstances.
                 */
                public void remove() throws MathUnsupportedOperationException {
                    throw new MathUnsupportedOperationException();
                }
            };
        }

The nested class refers to variable i. Currently, we can't see "i", as the parent of the anonymous class is "Iterator".

Anonymous classes not captured correctly

When there is an embedded class, i.e.:

private static final ToStringStyle TO_STRING_STYLE = new ToStringStyle() {
    ...
}

Couplings are captured as though they are part of the outer class.

For instance, super.appendDetail stays the same, as the outer class has no parent.

Handling items in List classes

When dealing with List classes, we get couplings that look like:

List<X>.get.getInterpolatedSecondaryState

However, the type we're dealing with is clearly not List, but X. On one hand, we can't always make this assumption, as we lack info on the inner-workings of non-project classes. On the other, we can make assumptions about known concrete List types from Java. Should we keep a list of those and override the current logic if such as class applies?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.