Skip to content

Test 4 #6

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .lift.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignoreFiles='''/tmp/'''
23 changes: 23 additions & 0 deletions effort-ranker/src/main/java/org/hjug/metrics/Person.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.mycompany.app;

class Person {
private String firstName;
private String lastName;
private String addr;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnusedVariable: The field 'addr' is never read.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]


public Person(final String firstName, final String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}

/**
* @return the firstName
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MissingSummary: A summary fragment is required; consider using the value of the @return block as a summary fragment instead.


Suggested change
* @return the firstName
*Returns the firstName.

ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

*/
public String getFirstName() {
return firstName;
}

public String getLastName() {
return lastName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

public class CBOClassParsingTest {

private String unused;

private Locale defaultLocale;

@BeforeEach
Expand Down
11 changes: 11 additions & 0 deletions effort-ranker/src/test/java/org/hjug/metrics/PersonTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.mycompany.app;

public class PersonTest {
public void testPerson() {
final String notUsed = "foo-bar";
}

private String getExpectedValue() {
return "I am not used";
}
}
33 changes: 33 additions & 0 deletions test/DupeTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.hjug.metrics;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Locale;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class DupeTest {

private String unused;

private Locale defaultLocale;

@BeforeEach
public void before() {
defaultLocale = Locale.getDefault(Locale.Category.FORMAT);
Locale.setDefault(Locale.Category.FORMAT, Locale.ENGLISH);
}

@AfterEach
public void after() {
Locale.setDefault(defaultLocale);
}

@Test
void test() {
String result = "A value of 20 may denote a high amount of coupling within the class";
CBOClass cboClass = new CBOClass("a", "a.txt", "org.hjug", result);
assertEquals(Integer.valueOf(20), cboClass.getCouplingCount());
}
}