You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package org.demo.codesmell.config;
public class AppConfig {
public static final String APP_PASSWORD = "appPassword";
public static final String Password = "password";
}
"""
prompt = f"""
Please review the following code, and you must find all the issues in the code:{code}"""
import ollama #ollama run codellama:34b-instruct-q5_K_M
from ollama import Options
It will return the following informations, 5 issues
The code you provided is a Java class that defines some constants for an application configuration. Here are the issues I found:
The naming convention for constants is not consistent. Some constants are in all caps, while others are camelCase. It's best to use a consistent naming convention throughout the code.
The Password constant is misspelled. It should be APP_PASSWORD.
The APP_PASSWORD constant is not used anywhere in the code. If it's not being used, it can be removed.
There are no getters or setters for the constants. It's best to provide getters and setters for each constant so that they can be accessed and modified from outside the class.
The class is not final, which means it can be extended. However, there is no need to extend this class as it only contains constants. It would be better to make the class final to prevent unintended inheritance.
But, as I just use the option, format="json", it just return 2 issues in json format, is that a bug?
The text was updated successfully, but these errors were encountered:
The code is below and problem i met is below:
code = """
"""
prompt = f"""
Please review the following code, and you must find all the issues in the code:{code}"""
import ollama #ollama run codellama:34b-instruct-q5_K_M
from ollama import Options
response = ollama.chat(model='codellama:34b-instruct-q5_K_M',
messages=[
{
'role': 'user',
'content': prompt,
},
],
#format="json",
#stream=True,
options=Options(
temperature=0,
#top_p=0.9,
#max_tokens=1024,
num_ctx=8192,
num_predict=-1)
)
print(response['message']["content"])
It will return the following informations, 5 issues
The code you provided is a Java class that defines some constants for an application configuration. Here are the issues I found:
Password
constant is misspelled. It should beAPP_PASSWORD
.APP_PASSWORD
constant is not used anywhere in the code. If it's not being used, it can be removed.But, as I just use the option, format="json", it just return 2 issues in json format, is that a bug?
The text was updated successfully, but these errors were encountered: