phodal/chapi

View on GitHub

Showing 85 of 390 total issues

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 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 codeCallFromExprList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private fun codeCallFromExprList(primaryExprCtx: GoParser.PrimaryExprContext): CodeCall {
                return when (val child = primaryExprCtx.getChild(0)) {
                    is GoParser.OperandContext -> {
                        CodeCall(NodeName = child.text)
                    }
        Severity: Minor
        Found in chapi-ast-go/src/main/kotlin/chapi/ast/goast/GoFullIdentListener.kt - About 1 hr to fix

          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 shouldIdentAnnotation has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Test
                fun shouldIdentAnnotation() {
                    val code = """
            using System; 
              

              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 buildMethodParameters has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      fun buildMethodParameters(paramListCtx: TypeScriptParser.ParameterListContext?): List<CodeProperty> {
                          var parameters: List<CodeProperty> = listOf()
                  
                          val type = paramListCtx!!.getChild(0)
                          when (type.parent) {

                    Method should_success_parse_test_usecase has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Method shouldIdentifyFirstFunctionCall has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          @Test
                          fun shouldIdentifyFirstFunctionCall() {
                              val code = """
                                  void aX(void);
                                  int a1(int param1);

                        Method parseParenthesizedExpression has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private fun parseParenthesizedExpression(context: ParenthesizedExpressionContext): List<CodeProperty> {
                                return context.expressionSequence().singleExpression().map { subSingle ->
                                    var parameter = CodeProperty(TypeValue = "", TypeType = "object")
                        
                                    when (subSingle) {

                          Method should parse valid protobuf code with message in message and return a CodeContainer has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              /// should support message in message
                              @Test
                              fun `should parse valid protobuf code with message in message and return a CodeContainer`() {
                                  // Given
                                  @Language("protobuf")

                            Method should parse valid protobuf code with enum and return a CodeContainer has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                /// should parse for enum
                                @Test
                                fun `should parse valid protobuf code with enum and return a CodeContainer`() {
                                    // Given
                                    @Language("protobuf")

                              Method toUml should return UML class representation for CodeDataStruct has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  @Test
                                  fun `toUml should return UML class representation for CodeDataStruct`() {
                                      // Given
                                      val codeDataStruct = CodeDataStruct(
                                          NodeName = "TestClass",

                                Method enterCreator has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    override fun enterCreator(ctx: JavaParser.CreatorContext?) {
                                        val variableName = ctx!!.getParent().getParent().getChild(0).text
                                        val allIdentifier = ctx.createdName().identifier()
                                        for (identifier in allIdentifier!!) {
                                            val createdName = identifier.text

                                  Method enterServiceDef has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      override fun enterServiceDef(ctx: Protobuf2Parser.ServiceDefContext?) {
                                          val dsName = ctx!!.serviceName().text
                                          val functions: List<CodeFunction> = ctx.serviceElement()?.mapNotNull { context ->
                                              if (context.rpc() == null) return@mapNotNull null
                                  
                                  

                                    Method enterClassSpecifier has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        override fun enterClassSpecifier(ctx: CPP14Parser.ClassSpecifierContext?) {
                                            ctx?.classHead()?.let {
                                                currentNode = CodeDataStruct()
                                    
                                                it.classKey()?.let { keyContext ->

                                      Method should_inline_variable has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              @Test
                                              internal fun should_inline_variable() {
                                                  val code = """
                                      package com.thoughtworks.archguard.packages.domain
                                           

                                        Method enterServiceDef has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            override fun enterServiceDef(ctx: Protobuf3Parser.ServiceDefContext?) {
                                                val dsName = ctx!!.serviceName().text
                                                val functions: List<CodeFunction> = ctx.serviceElement()?.mapNotNull { context ->
                                                    if (context.rpc() == null) return@mapNotNull null
                                        
                                        
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language