phodal/chapi

View on GitHub

Showing 85 of 390 total issues

Method shouldHandleForMacroForBrokenCondition has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Test
    fun shouldHandleForMacroForBrokenCondition() {
        val code = """
            static const ctl_named_node_t stats_mutexes_node[] = {
            #define OP(mtx) {NAME(#mtx), CHILD(named, stats_mutexes_##mtx)},

    Method shouldIdentifyCreator has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Test
        fun shouldIdentifyCreator() {
            val code = """
    package cc.arduino.packages.contributions;
    
    

      Method should identify method with parameters and return type has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              @Test
              internal fun `should identify method with parameters and return type`() {
                  val code = """
      package chapi.ast.kotlinast
      
      

        Method enterArrowFunctionDeclaration has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            // see also in function declaration
            override fun enterArrowFunctionDeclaration(ctx: TypeScriptParser.ArrowFunctionDeclarationContext?) {
                isCallbackOrAnonymousFunction = false
        
                when (val grad = ctx?.parent?.parent) {

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

              private fun handleStructOrUnion(ctx: CParser.StructOrUnionSpecifierContext?, nodeName: String) {
                  structMap.getOrPut(nodeName) {
                      CodeDataStruct(NodeName = nodeName, Position = buildPosition(ctx))
                  }.let {
                      currentDataStruct = it
          Severity: Minor
          Found in chapi-ast-c/src/main/kotlin/chapi/ast/cast/CFullIdentListener.kt - About 1 hr to fix

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

                                private fun constructEnum(child: Protobuf2Parser.EnumDefContext): CodeDataStruct {
                                    val name = child.enumName().text
                                    val enumDs = CodeDataStruct(
                                        NodeName = name,
                                        Type = DataStructType.ENUM,

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

                                        private fun constructEnum(child: Protobuf3Parser.EnumDefContext): CodeDataStruct {
                                            val name = child.enumName().text
                                            val enumDs = CodeDataStruct(
                                                NodeName = name,
                                                Type = DataStructType.ENUM,

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

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

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

                                            @Test
                                            fun bodyHashShouldReturnTrueWhenIdentifyTheSameCode() {
                                                val oldCode = """
                                                    package chapi.ast.javaast;
                                        
                                        
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language