eagletmt/kaede

View on GitHub

Showing 17 of 17 total issues

Function main has 92 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func main() {
    app := cli.NewApp()

    app.Usage = "CLI for kaede"
    app.Commands = []cli.Command{
Severity: Major
Found in kaede-cli/main.go - About 2 hrs to fix

    Class Recorder has 24 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Recorder
        def initialize(notifier)
          @notifier = notifier
        end
    
    
    Severity: Minor
    Found in lib/kaede/recorder.rb - About 2 hrs to fix

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

      func _Scheduler_Reload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(SchedulerReloadInput)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 2 hrs to fix
      kaede-cli/kaede/grpc/kaede.pb.go on lines 331..347
      kaede-cli/kaede/grpc/kaede.pb.go on lines 349..365
      kaede-cli/kaede/grpc/kaede.pb.go on lines 367..383
      kaede-cli/kaede/grpc/kaede.pb.go on lines 385..401
      kaede-cli/kaede/grpc/kaede.pb.go on lines 403..419

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

      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 6 locations. Consider refactoring.
      Open

      func _Scheduler_AddChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(AddChannelInput)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 2 hrs to fix
      kaede-cli/kaede/grpc/kaede.pb.go on lines 313..329
      kaede-cli/kaede/grpc/kaede.pb.go on lines 331..347
      kaede-cli/kaede/grpc/kaede.pb.go on lines 349..365
      kaede-cli/kaede/grpc/kaede.pb.go on lines 367..383
      kaede-cli/kaede/grpc/kaede.pb.go on lines 385..401

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

      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 6 locations. Consider refactoring.
      Open

      func _Scheduler_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(UpdateInput)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 2 hrs to fix
      kaede-cli/kaede/grpc/kaede.pb.go on lines 313..329
      kaede-cli/kaede/grpc/kaede.pb.go on lines 331..347
      kaede-cli/kaede/grpc/kaede.pb.go on lines 349..365
      kaede-cli/kaede/grpc/kaede.pb.go on lines 367..383
      kaede-cli/kaede/grpc/kaede.pb.go on lines 403..419

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

      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 6 locations. Consider refactoring.
      Open

      func _Scheduler_GetPrograms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(GetProgramsInput)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 2 hrs to fix
      kaede-cli/kaede/grpc/kaede.pb.go on lines 313..329
      kaede-cli/kaede/grpc/kaede.pb.go on lines 331..347
      kaede-cli/kaede/grpc/kaede.pb.go on lines 367..383
      kaede-cli/kaede/grpc/kaede.pb.go on lines 385..401
      kaede-cli/kaede/grpc/kaede.pb.go on lines 403..419

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

      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 6 locations. Consider refactoring.
      Open

      func _Scheduler_AddTid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(AddTidInput)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 2 hrs to fix
      kaede-cli/kaede/grpc/kaede.pb.go on lines 313..329
      kaede-cli/kaede/grpc/kaede.pb.go on lines 331..347
      kaede-cli/kaede/grpc/kaede.pb.go on lines 349..365
      kaede-cli/kaede/grpc/kaede.pb.go on lines 385..401
      kaede-cli/kaede/grpc/kaede.pb.go on lines 403..419

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

      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 6 locations. Consider refactoring.
      Open

      func _Scheduler_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
          in := new(SchedulerStopInput)
          if err := dec(in); err != nil {
              return nil, err
          }
      Severity: Major
      Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 2 hrs to fix
      kaede-cli/kaede/grpc/kaede.pb.go on lines 313..329
      kaede-cli/kaede/grpc/kaede.pb.go on lines 349..365
      kaede-cli/kaede/grpc/kaede.pb.go on lines 367..383
      kaede-cli/kaede/grpc/kaede.pb.go on lines 385..401
      kaede-cli/kaede/grpc/kaede.pb.go on lines 403..419

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

      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 prepare_tables has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def prepare_tables
            @db.create_table?(:channels) do
              primary_key :id
              String :name, size: 255, null: false, unique: true
              Integer :for_recorder, null: false, unique: true
      Severity: Minor
      Found in lib/kaede/database.rb - About 1 hr to fix

        Function main has 7 return statements (exceeds 4 allowed).
        Open

        func main() {
            app := cli.NewApp()
        
            app.Usage = "CLI for kaede"
            app.Commands = []cli.Command{
        Severity: Major
        Found in kaede-cli/main.go - About 45 mins to fix

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

          func (c *schedulerClient) AddChannel(ctx context.Context, in *AddChannelInput, opts ...grpc.CallOption) (*AddChannelOutput, error) {
              out := new(AddChannelOutput)
              err := grpc.Invoke(ctx, "/kaede.grpc.Scheduler/AddChannel", in, out, c.cc, opts...)
              if err != nil {
                  return nil, err
          Severity: Major
          Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 40 mins to fix
          kaede-cli/kaede/grpc/kaede.pb.go on lines 244..251
          kaede-cli/kaede/grpc/kaede.pb.go on lines 253..260
          kaede-cli/kaede/grpc/kaede.pb.go on lines 262..269
          kaede-cli/kaede/grpc/kaede.pb.go on lines 271..278
          kaede-cli/kaede/grpc/kaede.pb.go on lines 280..287

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

          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 6 locations. Consider refactoring.
          Open

          func (c *schedulerClient) Stop(ctx context.Context, in *SchedulerStopInput, opts ...grpc.CallOption) (*SchedulerStopOutput, error) {
              out := new(SchedulerStopOutput)
              err := grpc.Invoke(ctx, "/kaede.grpc.Scheduler/Stop", in, out, c.cc, opts...)
              if err != nil {
                  return nil, err
          Severity: Major
          Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 40 mins to fix
          kaede-cli/kaede/grpc/kaede.pb.go on lines 244..251
          kaede-cli/kaede/grpc/kaede.pb.go on lines 262..269
          kaede-cli/kaede/grpc/kaede.pb.go on lines 271..278
          kaede-cli/kaede/grpc/kaede.pb.go on lines 280..287
          kaede-cli/kaede/grpc/kaede.pb.go on lines 289..296

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

          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 6 locations. Consider refactoring.
          Open

          func (c *schedulerClient) GetPrograms(ctx context.Context, in *GetProgramsInput, opts ...grpc.CallOption) (*GetProgramsOutput, error) {
              out := new(GetProgramsOutput)
              err := grpc.Invoke(ctx, "/kaede.grpc.Scheduler/GetPrograms", in, out, c.cc, opts...)
              if err != nil {
                  return nil, err
          Severity: Major
          Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 40 mins to fix
          kaede-cli/kaede/grpc/kaede.pb.go on lines 244..251
          kaede-cli/kaede/grpc/kaede.pb.go on lines 253..260
          kaede-cli/kaede/grpc/kaede.pb.go on lines 271..278
          kaede-cli/kaede/grpc/kaede.pb.go on lines 280..287
          kaede-cli/kaede/grpc/kaede.pb.go on lines 289..296

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

          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 6 locations. Consider refactoring.
          Open

          func (c *schedulerClient) Update(ctx context.Context, in *UpdateInput, opts ...grpc.CallOption) (*UpdateOutput, error) {
              out := new(UpdateOutput)
              err := grpc.Invoke(ctx, "/kaede.grpc.Scheduler/Update", in, out, c.cc, opts...)
              if err != nil {
                  return nil, err
          Severity: Major
          Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 40 mins to fix
          kaede-cli/kaede/grpc/kaede.pb.go on lines 244..251
          kaede-cli/kaede/grpc/kaede.pb.go on lines 253..260
          kaede-cli/kaede/grpc/kaede.pb.go on lines 262..269
          kaede-cli/kaede/grpc/kaede.pb.go on lines 271..278
          kaede-cli/kaede/grpc/kaede.pb.go on lines 289..296

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

          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 6 locations. Consider refactoring.
          Open

          func (c *schedulerClient) Reload(ctx context.Context, in *SchedulerReloadInput, opts ...grpc.CallOption) (*SchedulerReloadOutput, error) {
              out := new(SchedulerReloadOutput)
              err := grpc.Invoke(ctx, "/kaede.grpc.Scheduler/Reload", in, out, c.cc, opts...)
              if err != nil {
                  return nil, err
          Severity: Major
          Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 40 mins to fix
          kaede-cli/kaede/grpc/kaede.pb.go on lines 253..260
          kaede-cli/kaede/grpc/kaede.pb.go on lines 262..269
          kaede-cli/kaede/grpc/kaede.pb.go on lines 271..278
          kaede-cli/kaede/grpc/kaede.pb.go on lines 280..287
          kaede-cli/kaede/grpc/kaede.pb.go on lines 289..296

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

          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 6 locations. Consider refactoring.
          Open

          func (c *schedulerClient) AddTid(ctx context.Context, in *AddTidInput, opts ...grpc.CallOption) (*AddTidOutput, error) {
              out := new(AddTidOutput)
              err := grpc.Invoke(ctx, "/kaede.grpc.Scheduler/AddTid", in, out, c.cc, opts...)
              if err != nil {
                  return nil, err
          Severity: Major
          Found in kaede-cli/kaede/grpc/kaede.pb.go and 5 other locations - About 40 mins to fix
          kaede-cli/kaede/grpc/kaede.pb.go on lines 244..251
          kaede-cli/kaede/grpc/kaede.pb.go on lines 253..260
          kaede-cli/kaede/grpc/kaede.pb.go on lines 262..269
          kaede-cli/kaede/grpc/kaede.pb.go on lines 280..287
          kaede-cli/kaede/grpc/kaede.pb.go on lines 289..296

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

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

              def redo_ts_process(program)
                unless system(Kaede.config.b25.to_s, '-v0', '-s1', '-m1', record_path(program).to_s, cache_path(program).to_s)
                  @notifier.notify_redo_error(program)
                  return false
                end
          Severity: Minor
          Found in lib/kaede/recorder.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