Showing 7 of 7 total issues

Method calculate_offset has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private static void calculate_offset(Integer offset_index) {
    List<Integer> entry1_vector;
    List<Integer> entry2_vector;

    try {
Severity: Minor
Found in java/CosineCalc.java - About 1 hr to fix

    Method get_vector has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      private static List<Integer> get_vector(List<Integer> list1, 
          Integer offset_index) {
        List<Integer> values = new ArrayList<Integer>();
        Integer count = -1;
        for(Integer value : list1) {
    Severity: Minor
    Found in java/CosineCalc.java - About 1 hr 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

    Method calculate_offset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      private static void calculate_offset(Integer offset_index) {
        List<Integer> entry1_vector;
        List<Integer> entry2_vector;
    
        try {
    Severity: Minor
    Found in java/CosineCalc.java - About 55 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

    Method calculate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def calculate
        puts 'Calculating similarity'
        @transcript_ids.each do |t1|
          puts "Transcript %s" % t1
          @transcript_ids.each do |t2|
    Severity: Minor
    Found in scripts/cosine_similarity.rb - About 35 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

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

    def transcripts_data(trace)
      data = [["Hours", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
               11, 12, 13, 14, 15, 16, 17, 18, 19]]
      transcript_ids = trace.gephi_records.map(&:transcript_id)
      max_y = 0
    Severity: Minor
    Found in routes.rb - 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

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

      private static void get_vectors() {
        try {
          System.out.println("Collecting vectors");
    
          for( Integer i = 0; i < transcripts_ids.size(); ++i ) {
    Severity: Minor
    Found in java/CosineCalc.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

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

      def format_cell_data(n)
        n = 0.0 if n && n < 0
        format = n ? n.round(2).to_s : "N/A"
        { v: n, f: format }
      end
    Severity: Minor
    Found in helpers.rb - 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