Showing 6 of 16 total issues
Repository
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class Repository {
private static final Logger LOG = Logger.getLogger(Repository.class.getName());
private final OfyRepository mOfyRepository;
private final LineRepository mLineRepository;
Method onLinePostBack
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void onLinePostBack(PostBackEvent event) {
String[] postBackData = event.getPostBackData().split("\n");
switch (postBackData[0]) {
case "data1":
{
Function sampleAjax
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sampleAjax(groupId, userId, displayName) {
var request = new XMLHttpRequest();
request.open('POST', '/content', false);
request.send(JSON.stringify({
groupId: groupId
Method post
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void post(URL url, Map<String, String> reqProp, String body, Callback callback) {
LOG.info("post url: " + url);
LOG.info("post reqProp: " + reqProp);
LOG.info("post body: " + body);
HttpURLConnection connection = null;
Method onLineWebhook
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private void onLineWebhook(HttpServletRequest req, HttpServletResponse resp) {
mRepository = new Repository();
mUseCase = new UseCase(mRepository);
try {
RequestBody requestBody = mRepository.getRequestBody(req);
- 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
Function sampleAjax
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function sampleAjax(groupId, userId, displayName) {
var request = new XMLHttpRequest();
request.open('POST', '/content', false);
request.send(JSON.stringify({
groupId: groupId
- 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"