Dalphi/dalphi

View on GitHub

Showing 1,441 of 1,441 total issues

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

  describe 'service preselection' do
    it 'should not connect services if no service available' do
      post projects_path,
           params: {
             project: {

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

  describe 'url' do
    it 'may not be nil' do
      @merge_service.url = nil
      expect(@merge_service).to be_invalid
    end
Severity: Minor
Found in spec/models/service_spec.rb by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

RSpec.configure do |config|
  # rspec-expectations config goes here. You can use an alternate
  # assertion/expectation library such as wrong or the stdlib/minitest
  # assertions if you prefer.
  config.expect_with :rspec do |expectations|
Severity: Minor
Found in spec/spec_helper.rb by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

RSpec.describe 'InterfaceType update', type: :request do
  before(:each) do
    @project = FactoryGirl.create :project
    @interface_type = FactoryGirl.create :interface_type
    @interface = FactoryGirl.create :interface,

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Class ProjectsController has 29 methods (exceeds 20 allowed). Consider refactoring.
Open

class ProjectsController < ApplicationController
  include ServiceRoles

  before_action :authenticate_user,
                only: [:index, :show]
Severity: Minor
Found in app/controllers/projects_controller.rb - About 3 hrs to fix

    File annotation_documents_spec.rb has 306 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'rails_helper'
    
    RSpec.configure do |config|
      config.include AnnotationDocumentHelper
    end
    Severity: Minor
    Found in spec/requests/api/v1/annotation_documents_spec.rb - About 3 hrs to fix

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

          it 'creates multiple annotation documents for list of valid annotation documents' do
            raw_datum = FactoryGirl.create(:raw_datum)
            expect(AnnotationDocument.count).to eq(0)
      
            post api_v1_annotation_documents_path(auth_token: @auth_token),

      This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

        describe 'selected_interfaces' do
          it 'should return an empty hash for no necessary interface types' do
            @project.iterate_service = nil
            @project.interfaces = []
            @project.save!
      Severity: Minor
      Found in spec/models/project_spec.rb by rubocop

      This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

        describe 'batch_create' do
          it 'can batch process a set of valid files' do
            expect(RawDatum.all.count).to eq(0)
            file_path_1 = Rails.root.join('spec/fixtures/text/valid1.md')
            file_path_2 = Rails.root.join('spec/fixtures/text/valid2.md')
      Severity: Minor
      Found in spec/models/raw_datum_spec.rb by rubocop

      This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

      File raw_datum_spec.rb has 279 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'rails_helper'
      
      RSpec.describe RawDatum, type: :model do
        before(:each) do
          @raw_datum = FactoryGirl.build(:raw_datum)
      Severity: Minor
      Found in spec/models/raw_datum_spec.rb - About 2 hrs to fix

        Method has too many lines. [18/10]
        Open

              def create
                ActiveRecord::Base.transaction do
                  raw_data = []
                  raw_data_params.each do |rd_params|
                    @raw_datum = raw_datum_from_params(rd_params)

        This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

        Method has too many lines. [18/10]
        Open

              def create
                ActionController::Parameters.permit_all_parameters = true
                annotation_documents = []
                annotation_documents_params.each do |ad_params|
                  @annotation_document = AnnotationDocument.new(ad_params)

        This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

        RSpec.describe 'Interface update', type: :request do
          before(:each) do
            @project = FactoryGirl.create(:project)
            @interface = FactoryGirl.create(:interface)
            sign_in(@project.admin)

        This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

          describe 'projects' do
            it 'should have and belong to many' do
              should have_and_belong_to_many(:projects)
            end
        
        
        Severity: Major
        Found in spec/models/annotator_spec.rb and 1 other location - About 2 hrs to fix
        spec/models/project_spec.rb on lines 205..235

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 92.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

          describe 'annotators' do
            it 'should have and belong to many' do
              should have_and_belong_to_many(:annotators)
            end
        
        
        Severity: Major
        Found in spec/models/project_spec.rb and 1 other location - About 2 hrs to fix
        spec/models/annotator_spec.rb on lines 16..46

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 92.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Method has too many lines. [17/10]
        Open

          def self.process_zip_archive(project, zip, temp_dir)
            require 'zip'
            batch_result = { success: [], error: [] }
            Zip::File.open(zip) do |zipfile|
              zipfile.each do |file|
        Severity: Minor
        Found in app/models/raw_datum.rb by rubocop

        This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

        Method has too many lines. [17/10]
        Open

              def create
                if params[:statistics].present?
                  create_bulk
                  render status: 200,
                         json: @statistics

        This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

              swagger_path '/raw_data/{id}' do
                operation :patch do
                  key :comsumes, ['application/json']
                  key :description, I18n.t('api.raw_datum.update.description')
                  key :operationId, 'raw_datum_update'
        Severity: Major
        Found in app/controllers/api/v1/raw_data_controller.rb and 2 other locations - About 2 hrs to fix
        app/controllers/api/v1/annotation_documents_controller.rb on lines 83..117
        app/controllers/api/v1/statistics_controller.rb on lines 82..116

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 90.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

              swagger_path '/annotation_documents/{id}' do
                operation :patch do
                  key :comsumes, ['application/json']
                  key :description, I18n.t('api.annotation_document.update.description')
                  key :operationId, 'annotation_document_update'
        Severity: Major
        Found in app/controllers/api/v1/annotation_documents_controller.rb and 2 other locations - About 2 hrs to fix
        app/controllers/api/v1/raw_data_controller.rb on lines 109..143
        app/controllers/api/v1/statistics_controller.rb on lines 82..116

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 90.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

              swagger_path '/statistics/{id}' do
                operation :patch do
                  key :comsumes, ['application/json']
                  key :description, I18n.t('api.statistic.update.description')
                  key :operationId, 'statistic_update'
        Severity: Major
        Found in app/controllers/api/v1/statistics_controller.rb and 2 other locations - About 2 hrs to fix
        app/controllers/api/v1/annotation_documents_controller.rb on lines 83..117
        app/controllers/api/v1/raw_data_controller.rb on lines 109..143

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 90.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language