alibaba/transmittable-thread-local

View on GitHub

Showing 86 of 208 total issues

Avoid too many return statements within this method.
Open

        return obj.hashCode();
Severity: Major
Found in ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ObjectUtils.java - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return NO_TRANSFORM;
    Severity: Major
    Found in ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlTransformer.java - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return null;

        Avoid too many return statements within this method.
        Open

                    return Arrays.equals((short[]) o1, (short[]) o2);
        Severity: Major
        Found in ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ObjectUtils.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return lineNum + 1;

            Avoid too many return statements within this method.
            Open

                            return nullSafeHashCode((float[]) obj);
            Severity: Major
            Found in ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ObjectUtils.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return nullSafeHashCode((short[]) obj);
              Severity: Major
              Found in ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ObjectUtils.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return classInfo.getCtClass().toBytecode();
                Severity: Major
                Found in ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlTransformer.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return false;
                  Severity: Major
                  Found in ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ObjectUtils.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return NO_TRANSFORM;

                      Avoid too many return statements within this method.
                      Open

                                      return nullSafeHashCode((long[]) obj);
                      Severity: Major
                      Found in ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ObjectUtils.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return nullSafeHashCode((char[]) obj);
                        Severity: Major
                        Found in ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ObjectUtils.java - About 30 mins to fix

                          Method clear has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              @NonNull
                              public Backup clear() {
                                  final Object data = callback.beforeReplay();
                          
                                  final HashMap<CrrTransmit<Object, Object>, Object> crrTransmit2Value = newHashMap(registeredCrrTransmitSet.size());

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method capture has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  @NonNull
                                  public static Object capture() {
                                      final HashMap<Transmittee<Object, Object>, Object> transmittee2Value = new HashMap<>(transmitteeSet.size());
                                      for (Transmittee<Object, Object> transmittee : transmitteeSet) {
                                          try {

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method clear has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  @NonNull
                                  public static Object clear() {
                                      final HashMap<Transmittee<Object, Object>, Object> transmittee2Value = new HashMap<>(transmitteeSet.size());
                                      for (Transmittee<Object, Object> transmittee : transmitteeSet) {
                                          try {

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method doTransform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              @Override
                              public void doTransform(@NonNull final ClassInfo classInfo) throws IOException, NotFoundException, CannotCompileException {
                                  // work-around ClassCircularityError:
                                  if (isClassAtPackageJavaUtil(classInfo.getClassName())) return;
                          
                          

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method replay has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              @NonNull
                              public Backup replay(@NonNull Capture captured) {
                                  final Object data = callback.beforeReplay();
                          
                                  final Snapshot capturedSnapshot = (Snapshot) captured;

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method mergeToClassLoader2ExtensionTransformlet has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private static void mergeToClassLoader2ExtensionTransformlet(
                                  Map<ClassLoader, Map<String, TtlTransformlet>> destination, Map<ClassLoader, Set<TtlTransformlet>> loadedTransformlets
                              ) {
                                  for (Map.Entry<ClassLoader, Set<TtlTransformlet>> entry : loadedTransformlets.entrySet()) {
                                      final ClassLoader classLoader = entry.getKey();

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method updateSubmitMethodsOfExecutorClass_decorateToTtlWrapperAndSetAutoWrapperAttachment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              @SuppressFBWarnings("VA_FORMAT_STRING_USES_NEWLINE") // [ERROR] Format string should use %n rather than \n
                              private void updateSubmitMethodsOfExecutorClass_decorateToTtlWrapperAndSetAutoWrapperAttachment(@NonNull final CtMethod method) throws NotFoundException, CannotCompileException {
                                  final int modifiers = method.getModifiers();
                                  if (!Modifier.isPublic(modifiers) || Modifier.isStatic(modifiers)) return;
                          
                          

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method nullSafeEquals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static boolean nullSafeEquals(@Nullable Object o1, @Nullable Object o2) {
                                  if (o1 == o2) {
                                      return true;
                                  }
                                  if (o1 == null || o2 == null) {
                          Severity: Minor
                          Found in ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ObjectUtils.java - About 25 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Severity
                          Category
                          Status
                          Source
                          Language