Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement some simplifications in the data model #391

Merged
merged 4 commits into from Aug 13, 2020

Conversation

amolenaar
Copy link
Member

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes

What is the current behavior?

There is some complexity in the data model that I like to get rid of.

What is the new behavior?

Slightly cleaner code.

Does this PR introduce a breaking change?

  • Yes
  • No -- not for the user

@amolenaar amolenaar marked this pull request as draft August 8, 2020 20:58
It's set in umlproperty already.
This can be done in the code generator already.
So they do not cause unneeded diffs in the code.
@amolenaar amolenaar force-pushed the simpler-data-model-properties branch from 0a15e93 to af1f44a Compare August 12, 2020 18:07
@amolenaar amolenaar marked this pull request as ready for review August 12, 2020 18:07
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 12, 2020

Sourcery Code Quality Report (beta)

Merging this PR leaves code quality unchanged.

Quality metrics Before After Change
Complexity 2.02 2.01 -0.01 🔵
Method Length 76.20 75.66 -0.54 🔵
Quality 8.66 8.66 0.00
Other metrics Before After Change
Lines 4501 4419 -82
Changed files Quality Before Quality After Quality Change
gaphor/SysML/sysml.py 5.06 5.06 0.00
gaphor/UML/uml.py 4.90 4.90 0.00
gaphor/UML/umloverrides.py 9.20 9.21 0.01 🔵
gaphor/codegen/profile_coder.py 7.74 7.72 -0.02 🔴
gaphor/codegen/writer.py 7.51 7.55 0.04 🔵
gaphor/codegen/tests/test_uml_coder.py 9.36 9.36 0.00
gaphor/core/modeling/coremodel.py 8.86 8.87 0.01 🔵
gaphor/core/modeling/properties.py 9.05 9.06 0.01 🔵
gaphor/core/modeling/tests/test_properties.py 8.09 8.10 0.01 🔵
gaphor/services/tests/test_undomanager.py 8.06 8.06 0.00

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Overall Recommendation
gaphor/core/modeling/properties.py derivedunion.propagate 35 212.95 3.04 Reduce complexity. Split out functionality
gaphor/codegen/profile_coder.py write_properties 36 202.66 3.08 Reduce complexity. Split out functionality
gaphor/codegen/writer.py Writer.add_attribute 17 235.61 4.23 Split out functionality
gaphor/codegen/writer.py Writer.add_derivedunion 18 169.74 4.82 Split out functionality
gaphor/core/modeling/tests/test_properties.py test_association_1_n 2 255.79 5.52 Split out functionality

Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@amolenaar amolenaar requested a review from danyeaw August 12, 2020 18:35
@amolenaar amolenaar added the chore Maintenance related PR label Aug 12, 2020
@amolenaar amolenaar added this to the 2.1 milestone Aug 12, 2020
@danyeaw danyeaw merged commit 851b0ad into master Aug 13, 2020
@danyeaw danyeaw deleted the simpler-data-model-properties branch August 13, 2020 01:54
@danyeaw
Copy link
Member

danyeaw commented Aug 13, 2020

Nice updates!

@amolenaar amolenaar modified the milestones: 2.1, 2.0.1 Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance related PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants