Showing 24 of 50 total issues
Method monitorDataExtractionUseCase
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
@Value("${app.monitor.extraction.maxRequests}") Integer maxExtractionRequests,
TwitterExtractionRepository twitterExtractionRepository,
TwitterRepository twitterRepository,
MonitorRepository monitorRepository,
PollRepository pollRepository) {
Method create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Proposal create(String pollId, String authorId, String authorNickname, String hashtag, String subject) {
Method extractAuthToken
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public AuthToken extractAuthToken(HttpServletRequest request) {
if (request.getCookies() != null) {
for (Cookie cookie : request.getCookies()) {
if (cookieName.equals(cookie.getName()) && !COOKIE_LOGOUT.equals(cookie.getValue())) {
return deserialize(cookie.getValue());
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method countTweets
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public Integer countTweets(String hashtag, Integer max) {
String queryString = new StringBuffer()
.append("count=").append(MAX_TWEETS_PER_QUERY)
.append("&q=").append(hashtag)
.toString();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"