phodal/chapi

View on GitHub

Showing 73 of 364 total issues

Method shouldSuccessHandleDs has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Test
    fun shouldSuccessHandleDs() {
        val code = """
            // https://stackoverflow.com/questions/12642830/can-i-define-a-function-inside-a-c-structure
            #include <stdio.h>

    Method enterMethod_invocation has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        // call from method invocation parent will be easy to search for method call
        override fun enterMethod_invocation(ctx: CSharpParser.Method_invocationContext?) {
            val parent = ctx?.parent ?: return
            val primaryExpr = when (parent) {
                is CSharpParser.Primary_expressionContext -> {

      Method buildMethodCallMethodInfo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private fun buildMethodCallMethodInfo(
              codeCall: CodeCall,
              callee: String = "",
              targetType: String?,
              ctx: JavaParser.MethodCallContext

        Method should inline variable to parameter has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                @Test
                internal fun `should inline variable to parameter`() {
                    val code = """
        package com.thoughtworks.archguard.packages.domain
             

          Method should_success_build_position_for_testing has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Test
              fun should_success_build_position_for_testing() {
                  val testCode = """
                     use std::sync::Arc;
          
          

            Method should_pass_for_multiple_impl has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Test
                fun should_pass_for_multiple_impl() {
                    val str = """
                        use std::cmp::Ordering;
                        use crate::embedding::Embedding;

              Method handleEmptyFullType has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private fun handleEmptyFullType(
                      ctx: JavaParser.MethodCallContext,
                      targetTypeObj: String,
                      methodName: String,
                      packageName: String

                Method should_handle_for_marco_call has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Test
                    fun should_handle_for_marco_call() {
                        val code = """
                            fn test_init_semantic() {
                                let model = std::fs::read("../model/model.onnx").unwrap();

                  Method bodyHashShouldReturnFalseWhenMethodHasBeenChangeInTheNextCommit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Test
                      fun bodyHashShouldReturnFalseWhenMethodHasBeenChangeInTheNextCommit() {
                          val oldCode = """
                              package chapi.ast.javaast;
                  
                  

                    Method enterVariableStatement has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        override fun enterVariableStatement(ctx: VariableStatementContext?) {
                            val isExport = ctx!!.parent.parent.getChild(0).text == "export"
                    
                            if (!isExport && ctx.variableDeclarationList() != null) {
                                defaultNode.Fields = variableToFields(ctx.variableDeclarationList())

                      Method analysis should return CodeContainer with correct field count 3 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          @Test
                          fun `analysis should return CodeContainer with correct field count 3`() {
                              // given
                              val tomlCode = """
                                  [database]

                        Method parseArguments has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private fun parseArguments(argument: TypeScriptParser.ArgumentsExpressionContext): List<CodeProperty> {
                                var params = listOf<CodeProperty>()
                        
                                // for: `axios<Module[]>({parameter}).then`
                                // create then and update parameter

                          Method bodyHashShouldReturnTrueWhenIdentifyTheSameCode has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @Test
                              fun bodyHashShouldReturnTrueWhenIdentifyTheSameCode() {
                                  val oldCode = """
                                      package chapi.ast.javaast;
                          
                          

                            Method allGrammarUnderResources has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Test
                                fun allGrammarUnderResources() {
                                    val content = this::class.java.getResource("/grammar")!!.toURI()
                            //        val content = "/Users/phodal/Downloads/redis-unstable/deps/lua"
                                    val totalStart = System.currentTimeMillis()

                              Method shouldHandleMacroInFunc has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  @Test
                                  fun shouldHandleMacroInFunc() {
                                      val code = """
                                          void os_pages_unmap(void *addr, size_t size) {
                                              assert(ALIGNMENT_ADDR2BASE(addr, os_page) == addr);

                                Method enterFieldDeclaration has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    override fun enterFieldDeclaration(ctx: JavaParser.FieldDeclarationContext?) {
                                        super.enterFieldDeclaration(ctx)
                                
                                        val declarators = ctx!!.variableDeclarators()
                                        val typeType = declarators.parent.getChild(0)

                                  Method variableToField has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private fun variableToField(
                                          it: TypeScriptParser.VariableDeclarationContext,
                                          modifiers: List<String>
                                      ): CodeField {
                                          val key = it.getChild(0).text

                                    Method should_handle_multiple_datastruct has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        @Test
                                        fun should_handle_multiple_datastruct() {
                                            val code = """
                                    package cc.unitmesh.pick.project
                                    
                                    

                                      Method enterClassDeclaration has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          override fun enterClassDeclaration(ctx: TypeScriptParser.ClassDeclarationContext?) {
                                              val nodeName = ctx!!.identifierName().text
                                      
                                              hasEnterClass = true
                                              currentNode = CodeDataStruct(

                                        Method shouldIdentAnnotation has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            @Test
                                            fun shouldIdentAnnotation() {
                                                val code = """
                                        using System; 
                                          
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language