Skip to content

Create file.java - #46

Open
NejlaSetkic wants to merge 1 commit into
mainfrom
NejlaSetkic-patch-48-1
Open

Create file.java#46
NejlaSetkic wants to merge 1 commit into
mainfrom
NejlaSetkic-patch-48-1

Conversation

@NejlaSetkic

Copy link
Copy Markdown
Owner

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes (Please run ./gradlew generateLock saveLock to refresh dependencies)
  • WHOSUSING.md
  • Other (please describe):

Changes in this PR

Describe the new behavior from this PR, and why it's needed
Issue #

Alternatives considered

Describe alternative implementation you have considered

@NejlaSetkic

Copy link
Copy Markdown
Owner Author

CodeScene PR Check


View detailed results in CodeScene

Quality Gates FAILED
Recommended Review Level Detailed -- Inspect the code that degrades in code health.

Warnings

Low Code Health for new/renamed Modules

  • file.java has a low code health score with 3.98.

Review of New Files

1 new file(s) below the threshold for new code (5).
0 new file(s) where the code health is above the threshold.

conductor/file.java

  • File Size Issue: This module has 1549 lines of code (comments stripped away). This puts the module at risk of evolving into a Brain Class. Brain Classes are problematic since changes become more complex over time, harder to test, and challenging to refactor. Act now to prevent future maintenance issues.
  • Brain Method: A Brain Method is a large and complex function that centralizes the behavior of the module. The more complex the brain method, the lower the code health. Brain Methods are detected using a combination of: Deeply Nested Logic + High Cyclomatic Complexity + Many Lines of Code + Accesses Many Arguments as described in Object-Oriented Metrics in Practice, by Lanza and Marinescu. Detected Brain Methods: rerunWF
  • Bumpy Road: A Bumpy Road is a function that contains multiple chunks of nested conditional logic inside the same function. The deeper the nesting and the more bumps, the lower the code health. Detected Bumpy Roads: rerunWF, decide, setTaskDomains, scheduleTask.
  • Deep, Nested Complexity: Deeply nested logic in: rerunWF (depth = 4)
  • Many Conditionals: Overall Code Complexity is measured by the mean cyclomatic complexity across all functions in the file. The lower the number, the better.
  • Complex Method: Complex implementations in: updateTask (cc = 23), scheduleTask (cc = 17), decide (cc = 17), terminateWorkflow (cc = 12), retry (cc = 11) and 1 more functions.. A Complex Method has a high cyclomatic complexity. The recommended threshold for the Java language is a cyclomatic complexity lower than 9.
  • Excess Number of Function Arguments: Excess arguments in: startWorkflow, startWorkflow, startWorkflow, startWorkflow, startWorkflow and 8 more functions. Functions with many arguments indicate either a) low cohesion where the function has too many responsibilities, or b) a missing abstraction that encapsulates those arguments.
  • Constructor Over-Injection: Counts the maximum number of arguments to each class' constructor. Too many arguments give a lower code health score. The rationale is that many constructor arguments indicate either a unit with low cohesion or an injection of dependencies on the wrong abstraction level. The threshold for the Java language is 5 constructor arguments.
  • Primitive Obsession: Code that uses a high degree of built-in, primitives such as integers, strings, floats, lacks a domain language that encapsulates the validation and semantics of function arguments. Primitive Obsession has several consequences: 1) In a statically typed language, the compiler will detect less erroneous assignments. 2) Security impact since the possible value range of a variable/argument isn't retricted.
  • String Heavy Function Arguments: String is a generic type that fail to capture the constraints of the domain object it represents. In this module, 45 % of all function arguments are string types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant