Cobertura

Overview

COBERTURA

Build Status

ABOUT

Cobertura is a free Java code coverage reporting tool. It is based on jcoverage 1.0.5. See the Cobertura web page and wiki for more details.

Since 2.0.0, Cobertura versions follow the Semantic versioning guidelines.

DOWNLOAD

You can download Cobertura from The Central Repository. That includes the distributions for stand-alone command line usage.

To use it as Maven dependency, you can use the following snippet:

<dependency>
    <groupId>net.sourceforge.cobertura</groupId>
    <artifactId>cobertura</artifactId>
    <version>2.1.1</version>
    <scope>test</scope>
</dependency>

COPYRIGHT

Code in the net.sourceforge.cobertura.javancss package is Copyright (C) 2000 Chr. Clemens Lee

See the included file "LICENSE.txt"

LICENSE

Cobertura is free software. Most of it is licensed under the GNU GPL, and you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Please review the file LICENSE.txt included in this distribution for further details. Parts of Cobertura are licensed under the Apache Software License, Version 1.1.

WARRANTY

Cobertura is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

CONVENTIONS

Before committing

  • check all tests pass
  • build the project, so that all code gets uniformly indented. A Maven plugin ensures this.

MAVEN MIGRATION NOTES

  • How do we get a good blame while all files were moved?

Use "git blame --follow" nameOfFile.java

Cobertura is built on Travis-CI.

Comments
  • ParseException JavaNCSS got an error while parsing the java file

    ParseException JavaNCSS got an error while parsing the java file

    In Cobertura 2.0.3, with gradle, parsing this code gives the below error. private ArrayList<String[][]> dUpdates = new ArrayList<String[][]>(); (...) for (String row[][] : dUpdates) { //<-- error here

    :generateCoberturaReport Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file net.sourceforge.cobertura.javancss.parser.ParseException: Encountered " ":" ": "" at line 417, column 30. Was expecting one of: "[" ... ";" ... "," ... "=" ...

        at net.sourceforge.cobertura.javancss.parser.JavaParser.generateParseException(JavaParser.java:11869)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.jj_consume_token(JavaParser.java:11730)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ForStatement(JavaParser.java:4292)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.Statement(JavaParser.java:3735)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.BlockStatement(JavaParser.java:3906)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.Block(JavaParser.java:3855)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.TryStatement(JavaParser.java:4534)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.Statement(JavaParser.java:3754)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.BlockStatement(JavaParser.java:3906)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.Block(JavaParser.java:3855)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.MethodDeclaration(JavaParser.java:1933)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ClassBodyDeclaration(JavaParser.java:1012)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ClassBody(JavaParser.java:874)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.UnmodifiedClassDeclaration(JavaParser.java:801)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.ClassDeclaration(JavaParser.java:706)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.TypeDeclaration(JavaParser.java:555)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.CompilationUnit(JavaParser.java:303)
        at net.sourceforge.cobertura.javancss.parser.JavaParser.parse(JavaParser.java:100)
        at net.sourceforge.cobertura.javancss.Javancss._measureSource(Javancss.java:192)
        at net.sourceforge.cobertura.javancss.Javancss._measureRoot(Javancss.java:268)
        at net.sourceforge.cobertura.javancss.Javancss.<init>(Javancss.java:346)
        at net.sourceforge.cobertura.reporting.ComplexityCalculator.getAccumlatedCCNForSource(ComplexityCalculator.java:105)
        at net.sourceforge.cobertura.reporting.ComplexityCalculator.getAccumlatedCCNForSingleFile(ComplexityCalculator.java:143)
        at net.sourceforge.cobertura.reporting.ComplexityCalculator.getCCNForSourceFileNameInternal(ComplexityCalculator.java:234)
        at net.sourceforge.cobertura.reporting.ComplexityCalculator.getCCNForPackageInternal(ComplexityCalculator.java:201)
        at net.sourceforge.cobertura.reporting.ComplexityCalculator.getCCNForProject(ComplexityCalculator.java:167)
        at net.sourceforge.cobertura.reporting.html.HTMLReport.generateTableRowForTotal(HTMLReport.java:603)
        at net.sourceforge.cobertura.reporting.html.HTMLReport.generateOverview(HTMLReport.java:287)
        at net.sourceforge.cobertura.reporting.html.HTMLReport.generateOverviews(HTMLReport.java:228)
        at net.sourceforge.cobertura.reporting.html.HTMLReport.<init>(HTMLReport.java:71)
        at net.sourceforge.cobertura.reporting.Main.parseArguments(Main.java:103)
        at net.sourceforge.cobertura.reporting.Main.main(Main.java:169)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:189)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
        at net.saliman.gradle.plugin.cobertura.CoberturaRunner.executeCobertura(CoberturaRunner.groovy:199)
        at net.saliman.gradle.plugin.cobertura.CoberturaRunner.this$2$executeCobertura(CoberturaRunner.groovy)
        at net.saliman.gradle.plugin.cobertura.CoberturaRunner$this$2$executeCobertura.callCurrent(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)
        at net.saliman.gradle.plugin.cobertura.CoberturaRunner.generateCoverageReport(CoberturaRunner.groovy:100)
        at net.saliman.gradle.plugin.cobertura.CoberturaRunner$generateCoverageReport.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
        at net.saliman.gradle.plugin.cobertura.GenerateReportTask.generateReports(GenerateReportTask.groovy:54)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:42)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:60)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:186)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:36)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
        at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:51)
        at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)
        at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)
        at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)
        at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
    

    JavaNCSS got an error while parsing the java file C:(...)\SyncTaskData.java ParseException in STDINronize.getTarget(ColumnMapping.SWITCH_CODE) != null) Last useful checkpoint: "(...).SyncTaskData.update(Tuple,PreparedStatement,PreparedStatement,PreparedStatement)" Encountered " ":" ": "" at line 417, column 30 Was expecting one of: "[" ... ";" ... "," ... "=" ...

    Parsing Issue 
    opened by mapo-job 98
  • Error when using Java 8

    Error when using Java 8

    I'm trying to run Cobertura for Java 8 project. I get errors like

    java.lang.VerifyError: Expecting a stackmap frame at branch target 78

    Using -XX:-UseSplitVerifier does not help since I think it was dropped in Java 8.

    opened by ghost 26
  • ERROR - loadCoverageData

    ERROR - loadCoverageData

    Hi, I have downloaded the source code for Gameoflife application and trying to follow the steps indicated in the book that uses this application to show Code coverage in Jenkins + Maven. I am very new to cobertura, running mvn clean package cobertura:cobertura, I get a coverage with 0.0 everywhere in spite of the fact that around 50 tests are run. The output is :+1: INFO] --- cobertura-maven-plugin:2.6:cobertura (default-cli) @ gameoflife-web --- [INFO] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Report time: 188ms

    [ERROR] févr. 24, 2015 3:46:52 PM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData INFO: Cobertura: Loaded information on 2 classes.

    [INFO] Cobertura Report generation was successful. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] gameoflife ......................................... SUCCESS [ 13.773 s] [INFO] gameoflife-build ................................... SUCCESS [ 0.703 s] [INFO] gameoflife-core .................................... SUCCESS [ 6.612 s] [INFO] gameoflife-web ..................................... SUCCESS [ 10.741 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 38.523 s [INFO] Finished at: 2015-02-24T15:46:52+01:00 [INFO] Final Memory: 28M/247M [INFO] ------------------------------------------------------------------------ [Cobertura] Publishing Cobertura coverage report... Publishing Cobertura coverage results... Cobertura coverage report found. Code coverage enforcement failed for the following metrics: Packages's stability is 0.0 and set mininum stability is 95.0. Methods's stability is 0.0 and set mininum stability is 80.0. Lines's stability is 0.0 and set mininum stability is 75.0. Conditionals's stability is 0.0 and set mininum stability is 75.0. Setting Build to unstable. Build step 'Publish Cobertura Coverage Report' changed build result to UNSTABLE Recording test results Publishing Javadoc Finished: UNSTABLE

    I ran the same command in a terminal and getting the same output.

    Thanks for your help

    Maven 
    opened by eliassal 20
  • With 2.0.3 still seeing ClassNotFoundException in-spite of using --auxClasspath during instrumentation

    With 2.0.3 still seeing ClassNotFoundException in-spite of using --auxClasspath during instrumentation

    Command Line used :- C:\cobertura-2.0.3\cobertura-instrument.bat --auxClasspath "c:\Program Files (x86)\XX\OIU\CLI\oiucli-1.0.0-jar-with-dependencies" --datafile "c:\cc\SER\oiu_cli.ser" "c:\Program Files (x86)\XX\OIU\CLI"\oiucli-1.0.0-jar-with-dependencies\com

    Sep 13, 2013 1:25:01 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData INFO: Cobertura: Loaded information on 40 classes. Sep 13, 2013 1:25:02 AM net.sourceforge.cobertura.coveragedata.TouchCollector registerClass SEVERE: Exception when registering class: com/xx/oiu/cli/OIUOption java.lang.ClassNotFoundException: com.xx.oiu.cli.OIUOption at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at net.sourceforge.cobertura.coveragedata.TouchCollector.registerClass(TouchCollector.java:80) at com.xx.oiu.cli.OIUOption.__cobertura_init(OIUOption.java) at com.xx.oiu.cli.OIUOption.(OIUOption.java) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at net.sourceforge.cobertura.instrument.CoberturaClassWriter.getCommonSuperClass(CoberturaClassWriter.java:32) at org.objectweb.asm.ClassWriter.a(Unknown Source) at org.objectweb.asm.Frame.a(Unknown Source) at org.objectweb.asm.Frame.a(Unknown Source) at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source) at org.objectweb.asm.MethodVisitor.visitMaxs(Unknown Source) at org.objectweb.asm.util.CheckMethodAdapter.visitMaxs(Unknown Source) at org.objectweb.asm.MethodVisitor.visitMaxs(Unknown Source) at org.objectweb.asm.MethodVisitor.visitMaxs(Unknown Source) at org.objectweb.asm.commons.LocalVariablesSorter.visitMaxs(Unknown Source) at org.objectweb.asm.tree.MethodNode.accept(Unknown Source) at org.objectweb.asm.util.CheckMethodAdapter$1.visitEnd(Unknown Source) at org.objectweb.asm.MethodVisitor.visitEnd(Unknown Source) at org.objectweb.asm.util.CheckMethodAdapter.visitEnd(Unknown Source) at org.objectweb.asm.ClassReader.b(Unknown Source) at org.objectweb.asm.ClassReader.accept(Unknown Source) at org.objectweb.asm.ClassReader.accept(Unknown Source) at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:205) at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121) at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234) at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298) at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307) at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:316) at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:316) at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:316) at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:316) at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399) at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)

    opened by wishabcd 19
  • Cobertura 2.0.4 will create breaking changes to plugins

    Cobertura 2.0.4 will create breaking changes to plugins

    I saw in 1ssue 74 that there is a planned 2.0.4 release for this week.

    The Main classes for instrumentation, reporting, etc have changed names in this release, which will cause any code trying to access Cobertura classes, such as existing plugins, to break when 2.0.4 is released. It might be a good idea to restore those class names to Main. This is particularly useful for plugins that are not tied to a particular Cobertura version, such as the Gradle Cobertura plugin, which works with whatever version the user specifies.

    Also, if there is time, it would also be good if all of the main classes had main methods that wrapped "runner" methods that don't use system.exit. I fixed one of them in issue 98, but I wasn't able to get to the instrumentation class, the report generation class, etc.

    Thanks,

    Steve

    opened by stevesaliman 17
  • using cobertura 2.0.3 fails with no coverage - fails in saveCoverageData

    using cobertura 2.0.3 fails with no coverage - fails in saveCoverageData

    Cobertura does not report coverage in Sonar for this project. I find the below error in jenkins log.

    Using Java7 and Cobertura 2.0.3

    [INFO] --- cobertura-maven-plugin:2.6:instrument (default-cli) @ domain-project ---[ERROR] Oct 29, 2013 4:23:53 PM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler saveCoverageData INFO: Cobertura: Saved information on 203 classes.

    [INFO] Instrumentation was successful. [INFO] NOT adding cobertura ser file to attached artifacts list.

    INFO] --- cobertura-maven-plugin:2.6:cobertura (default-cli) @ domain-payment --- [INFO] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file

    [ERROR] Oct 29, 2013 4:37:20 PM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData SEVERE: Cobertura: Error reading file /x/Mobile/projects/domain/domain-project/target/cobertura/cobertura.ser: null java.io.EOFException

    bug Maven 
    opened by maskbit 17
  • Fixes failing test cases and adds Java8 Lambdas and method references

    Fixes failing test cases and adds Java8 Lambdas and method references

    1. Fixed test problems by updating dependencies, deperacated APIs
    2. Updated latest javancss
    3. Added lambda and method references to the parser to support Java8
    opened by herenyi 16
  • NullPointerException in FindTouchPointsMethodAdapter.visitLineNumber

    NullPointerException in FindTouchPointsMethodAdapter.visitLineNumber

    Some of our classes throw NullPointerExceptions when cobertura tries to instrument those. This is the stacktrace:

    [cobertura-instrument] WARN   instrumentClass, Unable to instrument file /home/jenkins/jobs/Test Coverage/workspace/build/classes/path/to/package/AClass.class
    [cobertura-instrument] java.lang.NullPointerException
    [cobertura-instrument]  at java.util.LinkedList.addAll(LinkedList.java:269)
    [cobertura-instrument]  at java.util.LinkedList.addAll(LinkedList.java:247)
    [cobertura-instrument]  at java.util.LinkedList.<init>(LinkedList.java:98)
    [cobertura-instrument]  at net.sourceforge.cobertura.instrument.FindTouchPointsMethodAdapter.visitLineNumber(FindTouchPointsMethodAdapter.java:196)
    [cobertura-instrument]  at org.objectweb.asm.ClassReader.a(Unknown Source)
    [cobertura-instrument]  at org.objectweb.asm.ClassReader.b(Unknown Source)
    [cobertura-instrument]  at org.objectweb.asm.ClassReader.accept(Unknown Source)
    [cobertura-instrument]  at org.objectweb.asm.ClassReader.accept(Unknown Source)
    [cobertura-instrument]  at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:161)
    [cobertura-instrument]  at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
    [cobertura-instrument]  at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
    [cobertura-instrument]  at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
    [cobertura-instrument]  at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
    [cobertura-instrument]  at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
    [cobertura-instrument]  at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
    

    We are using Cobertura 2.0.3 and we instrument the classes using the ant task.

    When more info is needed, I'm happy to provide it.

    Affects 2.1.1 
    opened by oosterholt 14
  • Primitive class parser problem

    Primitive class parser problem

    [ERROR] j·n 10, 2013 12:45:49 PM net.sourceforge.cobertura.coveragedata.Coverage DataFileHandler loadCoverageData INFO: Cobertura: Loaded information on 43 classes. net.sourceforge.cobertura.javancss.parser.ParseException: Encountered " "." ". " " at line 105, column 29. Was expecting: ")" ...

    for code

            if ((boolean.class).equals(fieldType.getRawType()) || (Boolean.class).equals(fieldType.getRawType()) && field.getAnnotation(SerializeAsNumber.class) != null) {
    

    but no error if i change code

            Class<?> primitive = boolean.class;
            if ((primitive).equals(fieldType.getRawType()) || (Boolean.class).equals(fieldType.getRawType()) && field.getAnnotation(SerializeAsNumber.class) != null) {
    
    
    opened by igieon 13
  • Can we publish the latest snapshot to Maven Central?

    Can we publish the latest snapshot to Maven Central?

    I've seen a several issues lately relating to ASM and coverage levels. I've gotten a couple in the Gradle Cobertura plugin that also seems related to ASM. In the case of the Gradle issues, I've noticed that things seem to behave better in version 2.1.

    I'm thinking we should upload the latest 2.1 snapshot to the snapshot repository. If we do, we can have people try it out and let us know if things are better with the 2.1 release. I've uploaded the latest snapshot of the Gradle plugin, but I'm not authorized to publish Cobertura artifacts.

    I was also wanting to time my next Gradle plugin release around the production release of Cobertura 2.1 It seemed like that was right around the corner a little while ago, but I haven't seen anything lately. Is there a targeted release date?

    Maven 
    opened by stevesaliman 11
  • Fix for #250 NullPointerException in TouchCollector

    Fix for #250 NullPointerException in TouchCollector

    The problem is that if the intrumented classes are using slf4j logger, then we try to add it to registeredClasses which is not yet initialized leading to NPE. This change ensures that registeredClasses is initialized before the logger.

    opened by raghavgautam 10
  • Build Fails Despite 100% Coverage

    Build Fails Despite 100% Coverage

    Hi, My Jenkins version is Jenkins 2.346.3 and my Cobertura version is 1.16. I have unit tests for all codes. My thresholds are as shown below;

    " stage(‘UnitTest-Coverage’) { steps { sh “”" echo “Running Unit Tests” “”" junit ‘test.xml’ sh “”" echo “Running Cobertura Code Coverage” “”" cobertura autoUpdateHealth: false, autoUpdateStability: false, classCoverageTargets: ‘100, 0, 100’, coberturaReportFile: ‘coverage*.xml’, conditionalCoverageTargets: ‘10, 0, 10’, failUnhealthy: false, fileCoverageTargets: ‘100, 0, 100’, lineCoverageTargets: ‘70, 0, 70’, maxNumberOfBuilds: 0, methodCoverageTargets: ‘100, 0, 100’, onlyStable: false, packageCoverageTargets: ‘100, 0, 100’, sourceEncoding: ‘ASCII’, zoomCoverageChart: false sh “”" echo “Running Code Coverage” “”" publishCoverage adapters: [coberturaAdapter(‘coverage*.xml’)], failUnstable: true, globalThresholds: [[thresholdTarget: ‘Method’, unstableThreshold: 100.0], [thresholdTarget: ‘Package’, unstableThreshold: 100.0], [thresholdTarget: ‘Line’, unstableThreshold: 70.0], [thresholdTarget: ‘Conditional’, unstableThreshold: 10.0], [thresholdTarget: ‘Class’, unstableThreshold: 100.0], [thresholdTarget: ‘File’, unstableThreshold: 100.0]], sourceFileResolver: sourceFiles(‘STORE_LAST_BUILD’) "

    I get this error when I build ; Build failed because following metrics did not meet stability target: [Method {unstableThreshold=100.0, unhealthyThreshold=0.0}].

    My code coverage report is 100% btw.

    Why did fail the build?

    opened by omerzekvan 0
  • [SECURITY] Fix Temporary Directory Hijacking or Information Disclosure Vulnerability

    [SECURITY] Fix Temporary Directory Hijacking or Information Disclosure Vulnerability

    Security Vulnerability Fix

    This pull request fixes either 1.) Temporary Directory Hijacking Vulnerability, or 2.) Temporary Directory Information Disclosure Vulnerability, which existed in this project.

    Preamble

    The system temporary directory is shared between all users on most unix-like systems (not MacOS, or Windows). Thus, code interacting with the system temporary directory must be careful about file interactions in this directory, and must ensure that the correct file permissions are set.

    This PR was generated because the following chain of calls was detected in this repository in a way that leaves this project vulnerable. File.createTempFile(..) -> file.delete() -> either file.mkdir() or file.mkdirs().

    Impact

    This vulnerability can have one of two impacts depending upon which vulnerability it is.

    1. Temporary Directory Information Disclosure - Information in this directory is visable to other local users, allowing a malicious actor co-resident on the same machine to view potentially sensitive files.
    2. Temporary Directory Hijacking Vulnerability - Same impact as 1. above, but also, ther local users can manipulate/add contents to this directory. If code is being executed out of this temporary directory, it can lead to local priviledge escalation.

    Temporary Directory Hijacking

    This vulnerability exists because the return value from file.mkdir() or file.mkdirs() is not checked to determine if the call succeeded. Say, for example, because another local user created the directory before this process.

    File tmpDir = File.createTempFile("temp", ".dir"); // Attacker knows the full path of the directory that will be later created
    // delete the file that was created
    tmpDir.delete(); // Attacker sees file is deleted and begins a race to create their own directory before the java code.
    // and makes a directory of the same name
    // SECURITY VULNERABILITY: Race Condition! - Attacker beats java code and now owns this directory
    tmpDir.mkdirs(); // This method returns 'false' because it was unable to create the directory. No exception is thrown.
    // Attacker can write any new files to this directory that they wish.
    // Attacker can read any files created within this directory.
    

    Other Examples

    Temporary Directory Information Disclosure

    This vulnerability exists because, although the return values of file.mkdir() or file.mkdirs() are correctly checked, the permissions of the directory that is created follows the default system uname settings. Thus, the directory is created with everyone-readable permissions. As such, any files/directories written into this directory are viewable by all other local users on the system.

    File tmpDir = File.createTempFile("temp", ".dir");
    tmpDir.delete();
    if (!tmpDir.mkdirs()) { // Guard correctly prevents temporary directory hijacking, but directory contents are everyone-readable.
        throw new IOException("Failed to create temporary directory");
    }
    

    Other Examples

    The Fix

    The fix has been to convert the logic above to use the following API that was introduced in Java 1.7.

    File tmpDir = Files.createTempDirectory("temp dir").toFile();
    

    The API both created the directory securely, ie with a random, non-conflicting name, with directory permissions that only allow the currently executing user to read or write the contents of this directory.

    :arrow_right: Vulnerability Disclosure :arrow_left:

    :wave: Vulnerability disclosure is a super important part of the vulnerability handling process and should not be skipped! This may be completely new to you, and that's okay, I'm here to assist!

    First question, do we need to perform vulnerability disclosure? It depends!

    1. Is the vulnerable code only in tests or example code? No disclosure required!
    2. Is the vulnerable code in code shipped to your end users? Vulnerability disclosure is probably required!

    Vulnerability Disclosure How-To

    You have a few options options to perform vulnerability disclosure. However, I'd like to suggest the following 2 options:

    1. Request a CVE number from GitHub by creating a repository-level GitHub Security Advisory. This has the advantage that, if you provide sufficient information, GitHub will automatically generate Dependabot alerts for your downstream consumers, resolving this vulnerability more quickly.
    2. Reach out to the team at Snyk to assist with CVE issuance. They can be reached at the Snyk's Disclosure Email.

    Detecting this and Future Vulnerabilities

    This vulnerability was automatically detected by GitHub's LGTM.com using this CodeQL Query.

    You can automatically detect future vulnerabilities like this by enabling the free (for open-source) GitHub Action.

    I'm not an employee of GitHub, I'm simply an open-source security researcher.

    Source

    This contribution was automatically generated with an OpenRewrite refactoring recipe, which was lovingly hand crafted to bring this security fix to your repository.

    The source code that generated this PR can be found here: UseFilesCreateTempDirectory

    Opting-Out

    If you'd like to opt-out of future automated security vulnerability fixes like this, please consider adding a file called .github/GH-ROBOTS.txt to your repository with the line:

    User-agent: JLLeitschuh/security-research
    Disallow: *
    

    This bot will respect the ROBOTS.txt format for future contributions.

    Alternatively, if this project is no longer actively maintained, consider archiving the repository.

    CLA Requirements

    This section is only relevant if your project requires contributors to sign a Contributor License Agreement (CLA) for external contributions.

    It is unlikely that I'll be able to directly sign CLAs. However, all contributed commits are already automatically signed-off.

    The meaning of a signoff depends on the project, but it typically certifies that committer has the rights to submit this work under the same license and agrees to a Developer Certificate of Origin (see https://developercertificate.org/ for more information).

    - Git Commit Signoff documentation

    If signing your organization's CLA is a strict-requirement for merging this contribution, please feel free to close this PR.

    Sponsorship & Support

    This contribution is sponsored by HUMAN Security Inc. and the new Dan Kaminsky Fellowship, a fellowship created to celebrate Dan's memory and legacy by funding open-source work that makes the world a better (and more secure) place.

    This PR was generated by Moderne, a free-for-open source SaaS offering that uses format-preserving AST transformations to fix bugs, standardize code style, apply best practices, migrate library versions, and fix common security vulnerabilities at scale.

    Tracking

    All PR's generated as part of this fix are tracked here: https://github.com/JLLeitschuh/security-research/issues/10

    opened by JLLeitschuh 0
  • after upgrade of jenkins and cobertura plugin build fails

    after upgrade of jenkins and cobertura plugin build fails

    Please help to fix this,

    Jenkins version: [Jenkins 2.332.1] Cobertura Plugin: 1.17

    while running the bug below error comes up:

    [Pipeline] cobertura [Cobertura] Publishing Cobertura coverage report...

    [Cobertura] Publishing Cobertura coverage results...

    [Cobertura] Cobertura coverage report found.

    ERROR: ERROR: Failure to paint /home/ubuntu/workspace/central-ap-api-ci/ap_api/data_interface/kairos/interface_stats.py to /var/lib/jenkins/jobs/central-ap-api-ci/cobertura java.io.IOException: Failed to deserialize response to UserRequest:hudson.FilePath$Mkdirs@53389a46: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at hudson.remoting.Channel.call(Channel.java:1006) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at jenkins.security.s2m.CallableDirectionChecker.check(CallableDirectionChecker.java:63) at org.jenkinsci.remoting.RoleChecker.check(RoleChecker.java:39) at hudson.remoting.RequiredRoleCheckerWrapper.check(RequiredRoleCheckerWrapper.java:53) at jenkins.MasterToSlaveFileCallable.checkRoles(MasterToSlaveFileCallable.java:22) at hudson.FilePath$FileCallableWrapper.checkRoles(FilePath.java:3498) at hudson.remoting.ChannelBuilder$2.userRequest(ChannelBuilder.java:331) at hudson.remoting.CallableDecoratorList.wrapUserRequest(CallableDecoratorList.java:26) at hudson.remoting.UserRequest.perform(UserRequest.java:205) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at org.jenkinsci.remoting.CallableDecorator.call(CallableDecorator.java:18) at hudson.remoting.CallableDecoratorList.lambda$applyDecorator$0(CallableDecoratorList.java:19) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.lang.Thread.run(Thread.java:829) Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to channel at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1785) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:1000) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ERROR: ERROR: Failure to paint /home/ubuntu/workspace/central-ap-api-ci/ap_api/api/dao/network.py to /var/lib/jenkins/jobs/central-ap-api-ci/cobertura java.io.IOException: Failed to deserialize response to UserRequest:hudson.FilePath$Mkdirs@51610e3b: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at hudson.remoting.Channel.call(Channel.java:1006) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at jenkins.security.s2m.CallableDirectionChecker.check(CallableDirectionChecker.java:63) at org.jenkinsci.remoting.RoleChecker.check(RoleChecker.java:39) at hudson.remoting.RequiredRoleCheckerWrapper.check(RequiredRoleCheckerWrapper.java:53) at jenkins.MasterToSlaveFileCallable.checkRoles(MasterToSlaveFileCallable.java:22) at hudson.FilePath$FileCallableWrapper.checkRoles(FilePath.java:3498) at hudson.remoting.ChannelBuilder$2.userRequest(ChannelBuilder.java:331) at hudson.remoting.CallableDecoratorList.wrapUserRequest(CallableDecoratorList.java:26) at hudson.remoting.UserRequest.perform(UserRequest.java:205) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at org.jenkinsci.remoting.CallableDecorator.call(CallableDecorator.java:18) at hudson.remoting.CallableDecoratorList.lambda$applyDecorator$0(CallableDecoratorList.java:19) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.lang.Thread.run(Thread.java:829) Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to channel at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1785) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:1000) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ERROR: ERROR: Failure to paint /home/ubuntu/workspace/central-ap-api-ci/ap_api/data_api/external_apis.py to /var/lib/jenkins/jobs/central-ap-api-ci/cobertura java.io.IOException: Failed to deserialize response to UserRequest:hudson.FilePath$Mkdirs@3063ed0b: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at hudson.remoting.Channel.call(Channel.java:1006) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at jenkins.security.s2m.CallableDirectionChecker.check(CallableDirectionChecker.java:63) at org.jenkinsci.remoting.RoleChecker.check(RoleChecker.java:39) at hudson.remoting.RequiredRoleCheckerWrapper.check(RequiredRoleCheckerWrapper.java:53) at jenkins.MasterToSlaveFileCallable.checkRoles(MasterToSlaveFileCallable.java:22) at hudson.FilePath$FileCallableWrapper.checkRoles(FilePath.java:3498) at hudson.remoting.ChannelBuilder$2.userRequest(ChannelBuilder.java:331) at hudson.remoting.CallableDecoratorList.wrapUserRequest(CallableDecoratorList.java:26) at hudson.remoting.UserRequest.perform(UserRequest.java:205) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at org.jenkinsci.remoting.CallableDecorator.call(CallableDecorator.java:18) at hudson.remoting.CallableDecoratorList.lambda$applyDecorator$0(CallableDecoratorList.java:19) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.lang.Thread.run(Thread.java:829) Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to channel at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1785) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:1000) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ERROR: ERROR: Failure to paint /home/ubuntu/workspace/central-ap-api-ci/ap_api/utils/kafka_constants.py to /var/lib/jenkins/jobs/central-ap-api-ci/cobertura java.io.IOException: Failed to deserialize response to UserRequest:hudson.FilePath$Mkdirs@3ac463d0: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at hudson.remoting.Channel.call(Channel.java:1006) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at jenkins.security.s2m.CallableDirectionChecker.check(CallableDirectionChecker.java:63) at org.jenkinsci.remoting.RoleChecker.check(RoleChecker.java:39) at hudson.remoting.RequiredRoleCheckerWrapper.check(RequiredRoleCheckerWrapper.java:53) at jenkins.MasterToSlaveFileCallable.checkRoles(MasterToSlaveFileCallable.java:22) at hudson.FilePath$FileCallableWrapper.checkRoles(FilePath.java:3498) at hudson.remoting.ChannelBuilder$2.userRequest(ChannelBuilder.java:331) at hudson.remoting.CallableDecoratorList.wrapUserRequest(CallableDecoratorList.java:26) at hudson.remoting.UserRequest.perform(UserRequest.java:205) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at org.jenkinsci.remoting.CallableDecorator.call(CallableDecorator.java:18) at hudson.remoting.CallableDecoratorList.lambda$applyDecorator$0(CallableDecoratorList.java:19) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.lang.Thread.run(Thread.java:829) Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to channel at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1785) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:1000) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ERROR: ERROR: Failure to paint /home/ubuntu/workspace/central-ap-api-ci/ap_api/views/ap_v2.py to /var/lib/jenkins/jobs/central-ap-api-ci/cobertura java.io.IOException: Failed to deserialize response to UserRequest:hudson.FilePath$Mkdirs@533d104e: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at hudson.remoting.Channel.call(Channel.java:1006) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at jenkins.security.s2m.CallableDirectionChecker.check(CallableDirectionChecker.java:63) at org.jenkinsci.remoting.RoleChecker.check(RoleChecker.java:39) at hudson.remoting.RequiredRoleCheckerWrapper.check(RequiredRoleCheckerWrapper.java:53) at jenkins.MasterToSlaveFileCallable.checkRoles(MasterToSlaveFileCallable.java:22) at hudson.FilePath$FileCallableWrapper.checkRoles(FilePath.java:3498) at hudson.remoting.ChannelBuilder$2.userRequest(ChannelBuilder.java:331) at hudson.remoting.CallableDecoratorList.wrapUserRequest(CallableDecoratorList.java:26) at hudson.remoting.UserRequest.perform(UserRequest.java:205) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at org.jenkinsci.remoting.CallableDecorator.call(CallableDecorator.java:18) at hudson.remoting.CallableDecoratorList.lambda$applyDecorator$0(CallableDecoratorList.java:19) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.lang.Thread.run(Thread.java:829) Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to channel at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1785) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:1000) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ERROR: ERROR: Failure to paint /home/ubuntu/workspace/central-ap-api-ci/ap_api/data_api/location.py to /var/lib/jenkins/jobs/central-ap-api-ci/cobertura java.io.IOException: Failed to deserialize response to UserRequest:hudson.FilePath$Mkdirs@7aecf4bf: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited. See https://www.jenkins.io/redirect/security-144 for more details at hudson.remoting.Channel.call(Channel.java:1006) at hudson.FilePath.act(FilePath.java:1194) at hudson.FilePath.act(FilePath.java:1183) at hudson.FilePath.mkdirs(FilePath.java:1374) at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:64) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:140) at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:32) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3487) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.SecurityException: Sending hudson.FilePath$Mkdirs from agent to controller is prohibited.`

    opened by sahoode 0
  • What is

    What is "coverage-04.dtd"

    I don't see this defined any where. What is the -04 represent? The version? Is it v1.4 or v4? Is -03 an earlier version or a schema for another part of the project?

    It's even more confusing because the the docs say,

    Since 2.0.0, Cobertura versions follow the Semantic versioning guidelines.

    And it seems Cobertura is on version 2.1.1. So did Cobertura version 2.0.0 break compat with what seems to be the DTD of version 1.4? Is there a DTD for version 2.1.1?

    There are also two different versions of this dtd,

    1. A version in the cobertura/web repository
    2. A version in cobertura/cobertura under src/site/htdocs/xml/coverage-04.dtd the version has an edit which doesn't seem to be reflected anywhere in a changelog. This change (which adds complexity) is also declared #REQUIRED which would be a breaking change.. Exact line is <!ATTLIST method complexity CDATA #REQUIRED>. If this is a breaking change in the DTD, and version 2.0 marked the adoption of semvar, than this new DTD should versioned as a breaking change too: files created with the older DTD would not validate.
    opened by EvanCarroll 1
  • log4j vulnerability in cobertura  1.9.4.1

    log4j vulnerability in cobertura 1.9.4.1

    Hi Team,

    We been receiving vulnerable alert on our RHEL linux machines that related to log4j.jar that related to cobertura component.

    /opt/cobertura/noarch/1.9.4.1-3/lib/log4j-1.2.9.jar

    Any idea how can we apply fix for this cobertura component to avoid log4j issue.

    more about log4j vulnerable on https://www.dynatrace.com/news/blog/what-is-log4shell/?utm_source=google&utm_medium=cpc&utm_term=log4j%20vulnerability%20explained&utm_campaign=us-application-security&utm_content=none&gclid=Cj0KCQiAuvOPBhDXARIsAKzLQ8HF6n41AD31mYngkqQ-7sb6hF9POi9Z_QtwLqPJPnqJYbC7lZ-YgoUaAoybEALw_wcB&gclsrc=aw.ds

    if this is not correct forum to raise this query please suggest us any place to raise the same.

    Thanks

    Regards, Abinaya

    opened by AbinayaSandhiyaM 0
Owner
Cobertura
Cobertura