Dalphi/dalphi

View on GitHub

Showing 1,441 of 1,441 total issues

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

    swagger_root do
      key :swagger, '2.0'
      key :host, "#{ENV['DOMAIN']}#{":#{ENV['PORT']}" if ENV['PORT'] != ''}"
      key :basePath, '/api/v1'
      key :consumes, ['application/json']

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. [29/25]
Open

Teaspoon.configure do |config|
  # Determines where the Teaspoon routes will be mounted. Changing this to "/jasmine" would allow you to browse to
  # `http://localhost:3000/jasmine` to run your tests.
  config.mount_at = "/teaspoon"

Severity: Minor
Found in spec/teaspoon_env.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. [29/25]
Open

  describe 'compiled_stylesheet' do
    it 'can be nil or empty iff stylesheet is nil' do
      @interface.stylesheet = nil
      @interface.compiled_stylesheet = nil
      expect(@interface).to be_valid
Severity: Minor
Found in spec/models/interface_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. [29/25]
Open

    it 'is the compiled version of the java_script' do
      begin
        file = Tempfile.new('java_script')
        file.write(
          <<-COFFEE.gsub(/^ {12}/, '')
Severity: Minor
Found in spec/models/interface_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. [29/25]
Open

    it 'creates one statistic for a singleton' do
      project = FactoryGirl.create(:project)
      statistic = FactoryGirl.build(:statistic, project: project)
      expect(Statistic.count).to eq(0)

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. [29/25]
Open

    it 'creates no annotation documents for list of partly 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. [29/25]
Open

  it "shows selected interfaces' titles grouped by type" do
    interface_type_1 = FactoryGirl.create(:interface_type_text_nominal)
    interface_type_2 = FactoryGirl.create(:interface_type_other)
    @project.iterate_service = FactoryGirl.create(:iterate_service,
                                                  interface_types: [

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

      expect(json).to eq(
        [
          {
            'id' => statistic_1.id,
            'key' => statistic_1.key,
Severity: Minor
Found in spec/requests/api/v1/statistics_spec.rb and 1 other location - About 40 mins to fix
spec/requests/api/v1/statistics_spec.rb on lines 196..212

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 37.

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

      expect(json).to eq(
        [
          {
            'id' => statistic_1.id,
            'key' => statistic_1.key,
Severity: Minor
Found in spec/requests/api/v1/statistics_spec.rb and 1 other location - About 40 mins to fix
spec/requests/api/v1/statistics_spec.rb on lines 274..290

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 37.

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 new_service_flash_text has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def new_service_flash_text(uri)
      if @service
        @service.validate
        url_error = @service.errors.details[:url].first
        flash_text = I18n.t('services.searching.already-taken-url')
Severity: Minor
Found in app/controllers/services_controller.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

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

  swagger_schema :RawDatum do
    key :required,
        [
          :shape,
          :data,
Severity: Minor
Found in app/models/raw_datum.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. [28/25]
Open

  describe 'interfaces' do
    it { should have_and_belong_to_many(:interfaces) }

    it 'can be empty' do
      @project.interfaces = []
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. [28/25]
Open

  describe 'role' do
    it 'may not be nil' do
      @merge_service.role = 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. [28/25]
Open

  it 'creates a JSON stringify encoded statistic' do
    project = FactoryGirl.create(:project)
    statistic = FactoryGirl.build(:statistic, project: project)
    expect(Statistic.count).to eq(0)

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. [28/25]
Open

  it 'patches a JSON stringify encoded statistic' do
    project = FactoryGirl.create(:project)
    statistic = FactoryGirl.create(:statistic, project: project)
    expect(Statistic.count).to eq(1)

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. [28/25]
Open

  it 'creates a service with valid data' do
    expect(Service.count).to eq(0)

    interface_type_text_nominal = FactoryGirl.create(:interface_type_text_nominal)
    interface_type_ner_complete = FactoryGirl.create(:interface_type_ner_complete)

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. [28/25]
Open

  describe 'new project & project creation' do
    it 'should render the new project form', focus: true do
      get new_project_path
      expect(response).to render_template(:new)
    end

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. [28/25]
Open

RSpec.describe 'Project create', type: :request do
  before(:each) do
    @project = FactoryGirl.build(:project)
    sign_in(@project.admin)
  end

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

    it 'cannot have one or more elements for machine learning service' do
      interface_type_1 = FactoryGirl.create(:interface_type, name: 'fancy_interface')
      @ml_service.interface_types << interface_type_1
      expect(@ml_service).to be_invalid

Severity: Minor
Found in spec/models/service_spec.rb and 1 other location - About 35 mins to fix
spec/models/service_spec.rb on lines 294..302

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 34.

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

    it 'cannot have one or more elements for merge service' do
      interface_type_1 = FactoryGirl.create(:interface_type, name: 'fancy_interface')
      @merge_service.interface_types << interface_type_1
      expect(@merge_service).to be_invalid

Severity: Minor
Found in spec/models/service_spec.rb and 1 other location - About 35 mins to fix
spec/models/service_spec.rb on lines 278..286

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 34.

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