Showing 50 of 50 total issues
File management.pb.go
has 917 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.17.3
// source: api/graphql_server/proto/torchserve/v1/management.proto
Method main
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void main(String[] args) throws Exception {
final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
// String paramsFilePath = "data-processing/flink/applications/stream-tweets/src/main/resources/application-development.properties";
String paramsFilePath = "application-production.properties";
Function helmetMiddleware
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
const helmetMiddleware = (
cspConnectSrc: ReadonlyArray<string> = CSP_CONNECT_SRC,
cspReportURI: string = CSP_REPORT_URI,
): RequestHandler => {
return (req: Request, res: Response, next: NextFunction) => {
Function file_api_graphql_server_proto_torchserve_v1_management_proto_init
has 107 lines of code (exceeds 50 allowed). Consider refactoring. Open
func file_api_graphql_server_proto_torchserve_v1_management_proto_init() {
if File_api_graphql_server_proto_torchserve_v1_management_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
Function useAuth
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useAuth = (): UseAuth => {
const { clearMe, updateMe } = useMe();
const signIn = async (email: string, password: string): Promise<void> => {
try {
Function train
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def train(args):
is_distributed = len(args.hosts) > 1 and args.backend is not None
logging.info("Distributed training:", is_distributed)
use_cuda = args.num_gpus > 0
- 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 forward
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def forward(self, batched_data):
x, edge_index, edge_attr, batch = (
batched_data.x,
batched_data.edge_index,
batched_data.edge_attr,
- 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 SignIn
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SignIn() {
const { signIn } = useAuth();
const { me } = useMe();
const mutation = useMutation((data: FormValues) => {
Function GetMe
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
func GetMe(id string) (*Me, error) {
config := GetConfig()
conn, err := grpc.NewClient(
config.DgraphHost+":"+config.DgraphGRPCPort,
grpc.WithUnaryInterceptor(apmgrpc.NewUnaryClientInterceptor()),
Function rateLimitMiddleware
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const rateLimitMiddleware = (
redis: Redis,
points: number = POINTS,
duration: number = DURATION,
burstPointsRate: number = BURST_POINTS_RATE,
Function main
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main() -> None:
wing_airfoil = asb.Airfoil("sd7037")
tail_airfoil = asb.Airfoil("naca0010")
# Define the 3D geometry you want to analyze/optimize
Function OPALExperiment
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function OPALExperiment() {
const [readDogData, setReadDogData] = React.useState<any>(undefined);
const [adoptDogData, setAdoptDogData] = React.useState<any>(undefined);
const onReadDog = async () => {
Function Home
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Home(props: Props) {
const { me, subscribePing } = props;
React.useEffect(() => {
// queryMe(meQuery);
Function main
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def main():
# Training settings
args = get_args()
with wandb.init(
- 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 file_api_graphql_server_proto_torchserve_v1_inference_proto_init
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
func file_api_graphql_server_proto_torchserve_v1_inference_proto_init() {
if File_api_graphql_server_proto_torchserve_v1_inference_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
Function GetUserByEmail
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
func GetUserByEmail(email string) (*types.User, error) {
config := GetConfig()
conn, err := grpc.NewClient(
config.DgraphHost+":"+config.DgraphGRPCPort,
grpc.WithUnaryInterceptor(apmgrpc.NewUnaryClientInterceptor()),
Function plugin
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const plugin = new PanelPlugin<SimpleOptions>(HMPanel).setPanelOptions((builder) => {
return builder
.addTextInput({
path: 'text',
name: 'Simple text option',
Function initTracer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const initTracer = (): void => {
const tracerProvider = new NodeTracerProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'hm-api-trace-service',
}),
Function App
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function App() {
const [isAppReady, setIsAppReady] = React.useState(false);
React.useEffect(() => {
const prepare = async () => {
Function __init__
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
num_tasks,
num_layer=5,
emb_dim=300,
- 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"