ServiceInnovationLab/serviceinnovationlab.github.io

View on GitHub

Showing 134 of 135 total issues

Consider simplifying this complex logical expression.
Open

if url.is_a? Array
urls = url.map do |u|
page_url = clip_char(page_url.to_s.downcase, '/').split('/')[0]
u = clip_char(u.to_s.downcase, '/').split('/')[0]
# if the url group is 'blog', match date strings
Severity: Major
Found in _plugins/utility.rb - About 40 mins to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    if @use_tags
    post.data['tags'].each do |tag|
    if me.data['tags'].include?(tag) && post != me
    cat_freq = @tag_freq[tag]
    related_scores[post] += (1 + highest_freq - cat_freq)
    Severity: Minor
    Found in _plugins/related_posts.rb and 1 other location - About 35 mins to fix
    _plugins/related_posts.rb on lines 19..24

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    if @use_categories
    post.data['categories'].each do |category|
    if me.data['categories'].include?(category) && post != me
    cat_freq = @tag_freq[category]
    related_scores[post] += (1 + highest_freq - cat_freq)
    Severity: Minor
    Found in _plugins/related_posts.rb and 1 other location - About 35 mins to fix
    _plugins/related_posts.rb on lines 27..32

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    vertical: {
    newScroll: this.$element.scrollTop(),
    oldScroll: this.oldScroll.y,
    forward: 'down',
    backward: 'up',
    Severity: Minor
    Found in assets/js/waypoints.min.js and 1 other location - About 30 mins to fix
    assets/js/waypoints.min.js on lines 79..84

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    horizontal: {
    newScroll: this.$element.scrollLeft(),
    oldScroll: this.oldScroll.x,
    forward: 'right',
    backward: 'left',
    Severity: Minor
    Found in assets/js/waypoints.min.js and 1 other location - About 30 mins to fix
    assets/js/waypoints.min.js on lines 85..90

    Avoid too many return statements within this function.
    Open

    return n.error(
    'The ' + r + ' method does not exist in jQuery Waypoints.',
    );
    Severity: Major
    Found in assets/js/waypoints.min.js - About 30 mins to fix

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

      def tag_freq(posts)
      @tag_freq = Hash.new(0)
      posts.docs.each do |post|
      post.data['categories'].each { |category| @tag_freq[category] += 1 } if @use_categories
      post.data['tags'].each { |tag| @tag_freq[tag] += 1 } if @use_tags
      Severity: Minor
      Found in _plugins/related_posts.rb - About 25 mins to fix

      Block has too many lines. [26/25]
      Open

      describe '#matches_url' do
      context 'it is given a link' do
      it 'strips forward slashes' do
      url = 'text'
      expect(@utility_class.matches_url('/text/', url)).to be true
      Severity: Minor
      Found in spec/_plugins/utlity_spec.rb by rubocop

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      it 'does not update a file if it does not need updating' do
      author_name = @author_data.fetch('author_with_content', 'name')
      expect(author_name).to eq 'burt'
       
      @author_data.update('author_with_content.md', 'name', 'burt')
      Severity: Minor
      Found in spec/_plugins/author_data_spec.rb and 1 other location - About 25 mins to fix
      spec/_plugins/author_data_spec.rb on lines 77..83

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      it 'does not update a file if it does not need updating' do
      author_name = @author_data.fetch('author', 'name')
      expect(author_name).to eq 'aaron'
       
      @author_data.update('author.md', 'name', 'aaron')
      Severity: Minor
      Found in spec/_plugins/author_data_spec.rb and 1 other location - About 25 mins to fix
      spec/_plugins/author_data_spec.rb on lines 164..170

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      if a == '-d' || a == '-D' || a == '--dir_temp'
      directory_name = ARGV[index + 1] ? ARGV[index + 1] : directory_name
      end
      Severity: Minor
      Found in check_images.rb and 2 other locations - About 15 mins to fix
      check_images.rb on lines 38..40
      check_images.rb on lines 43..45

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      if a == '-b' || a == '-B' || a == '--built'
      built_path = ARGV[index + 1] ? ARGV[index + 1] : built_path
      end
      Severity: Minor
      Found in check_images.rb and 2 other locations - About 15 mins to fix
      check_images.rb on lines 38..40
      check_images.rb on lines 48..50

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      if a == '-i' || a == '-I' || a == '--image'
      image_path = ARGV[index + 1] ? ARGV[index + 1] : image_path
      end
      Severity: Minor
      Found in check_images.rb and 2 other locations - About 15 mins to fix
      check_images.rb on lines 43..45
      check_images.rb on lines 48..50

      Use double pipes || instead.
      Open

      @basepath = @test_path ? @test_path : Dir.pwd
      Severity: Minor
      Found in _plugins/author_data.rb by rubocop

      Double quote to prevent globbing and word splitting.
      Open

      pid=$(echo $line | awk '{print $2}')
      Severity: Minor
      Found in killport by shellcheck

      Use double pipes || instead.
      Open

      site.config['n_cores'] ? site.config['n_cores'] : 1
      Severity: Minor
      Found in _plugins/related_posts.rb by rubocop

      Double quote to prevent globbing and word splitting.
      Open

      echo $line
      Severity: Minor
      Found in killport by shellcheck

      Method parameter must be at least 3 characters long.
      Open

      def related_posts(me, posts)
      Severity: Minor
      Found in _plugins/related_posts.rb by rubocop

      Use a guard clause instead of wrapping the code inside a conditional expression.
      Open

      if Jekyll.sites[0].config['env'] != 'development'
      Severity: Minor
      Found in _plugins/team.rb by rubocop

      Avoid multi-line chains of blocks.
      Open

      end.collect { |post, _freq| post }
      Severity: Minor
      Found in _plugins/related_posts.rb by rubocop
      Severity
      Category
      Status
      Source
      Language